C# Class Microsoft.SqlServer.TDS.TDSStream

Stream that wraps the data with TDS protocol
Inheritance: Stream
显示文件 Open project: dotnet/corefx Class Usage Examples

Private Properties

Property Type Description
_AllocateIncomingPacket void
_AllocateOutgoingPacket void
_CreateOutgoingPacket void
_EnsureIncomingPacketHasData bool
_EnsureOutgoingPacketHasSpace void
_MoveToNextIncomingPacketHeader bool
_SendCurrentPacket void

Public Methods

Method Description
Close ( ) : void

Close the stream

EndMessage ( ) : void

Send the last packet of the message and complete the request/response

Flush ( ) : void

Flush the data into the underlying stream

Read ( byte buffer, int offset, int count ) : int

Read the data from the stream

ReadNextHeader ( ) : bool

Read packet header

Seek ( long offset, SeekOrigin origin ) : long

Seek position in the stream

SetLength ( long value ) : void

Set stream length

StartMessage ( TDSMessageType type ) : void

Start a new message

TDSStream ( Stream innerStream ) : System

Initialization constructor

TDSStream ( Stream innerStream, bool leaveInnerStreamOpen ) : System

Initialization constructor

Write ( byte buffer, int offset, int count ) : void

Write data into the stream

Private Methods

Method Description
_AllocateIncomingPacket ( ) : void

Prepare to read and inflate incoming packet

_AllocateOutgoingPacket ( ) : void

Allocate or reallocate a packet

_CreateOutgoingPacket ( TDSMessageType type, byte packetID ) : void

Create a new TDS packet in the message

_EnsureIncomingPacketHasData ( ) : bool

This routine checks whether current packet still has data to read and moves to the next if it doesn't

_EnsureOutgoingPacketHasSpace ( ) : void

Ensures that the current packet has at least a single spare byte

_MoveToNextIncomingPacketHeader ( ) : bool

Skip current packet if it is pending and move to the next packet, reading only the header

_SendCurrentPacket ( ) : void

Serialize current packet into the underlying stream

Method Details

Close() public method

Close the stream
public Close ( ) : void
return void

EndMessage() public method

Send the last packet of the message and complete the request/response
public EndMessage ( ) : void
return void

Flush() public method

Flush the data into the underlying stream
public Flush ( ) : void
return void

Read() public method

Read the data from the stream
public Read ( byte buffer, int offset, int count ) : int
buffer byte
offset int
count int
return int

ReadNextHeader() public method

Read packet header
public ReadNextHeader ( ) : bool
return bool

Seek() public method

Seek position in the stream
public Seek ( long offset, SeekOrigin origin ) : long
offset long
origin SeekOrigin
return long

SetLength() public method

Set stream length
public SetLength ( long value ) : void
value long
return void

StartMessage() public method

Start a new message
public StartMessage ( TDSMessageType type ) : void
type TDSMessageType Type of the message to start
return void

TDSStream() public method

Initialization constructor
public TDSStream ( Stream innerStream ) : System
innerStream Stream
return System

TDSStream() public method

Initialization constructor
public TDSStream ( Stream innerStream, bool leaveInnerStreamOpen ) : System
innerStream Stream
leaveInnerStreamOpen bool
return System

Write() public method

Write data into the stream
public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void