SmiStream.cs 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. //------------------------------------------------------------------------------
  2. // <copyright file="SmiStream.cs" company="Microsoft">
  3. // Copyright (c) Microsoft Corporation. All rights reserved.
  4. // </copyright>
  5. // <owner current="true" primary="true">alazela</owner>
  6. // <owner current="true" primary="false">stevesta</owner>
  7. //------------------------------------------------------------------------------
  8. // Stream-like object that uses SmiEventSink for server-side errors.
  9. namespace Microsoft.SqlServer.Server {
  10. using System;
  11. using System.IO;
  12. internal abstract class SmiStream {
  13. public abstract bool CanRead {
  14. get;
  15. }
  16. // If CanSeek is false, Position, Seek, Length, and SetLength should throw.
  17. public abstract bool CanSeek {
  18. get;
  19. }
  20. public abstract bool CanWrite {
  21. get;
  22. }
  23. public abstract long GetLength( SmiEventSink sink );
  24. public abstract long GetPosition( SmiEventSink sink );
  25. public abstract void SetPosition( SmiEventSink sink, long position );
  26. public abstract void Flush( SmiEventSink sink );
  27. public abstract long Seek( SmiEventSink sink, long offset, SeekOrigin origin );
  28. public abstract void SetLength( SmiEventSink sink, long value );
  29. public abstract int Read( SmiEventSink sink, byte[] buffer, int offset, int count );
  30. public abstract void Write( SmiEventSink sink, byte[] buffer, int offset, int count );
  31. public abstract int Read( SmiEventSink sink, char[] buffer, int offset, int count );
  32. public abstract void Write( SmiEventSink sink, char[] buffer, int offset, int count );
  33. }
  34. }