[]
        
(Showing Draft Content)

C1.Util.DX.DataStream.Read

Read Method

Read<T>()

Reads a single value from the current stream and advances the current position within this stream by the number of bytes read.

Declaration
public T Read<T>() where T : struct
Returns
Type Description
T

The value that was read.

Type Parameters
Name Description
T

The type of the value to be read from the stream.

Remarks

In order to provide faster read/write, this operation doesn't check stream bound. A client must carefully not read/write above the size of this datastream.

Exceptions
Type Condition
NotSupportedException

This stream does not support reading.

Read(byte[], int, int)

Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read.

Declaration
public override int Read(byte[] buffer, int offset, int count)
Parameters
Type Name Description
byte[] buffer

An array of values to be read from the stream.

int offset

The zero-based byte offset in buffer at which to begin storing the data read from the current stream.

int count

The maximum number of bytes to be read from the current stream.

Returns
Type Description
int

The number of bytes read from the stream.

Overrides
Remarks

In order to provide faster read/write, this operation doesn't check stream bound. A client must carefully not read/write above the size of this datastream.

Exceptions
Type Condition
NotSupportedException

This stream does not support reading.

Read(IntPtr, int, int)

Reads a sequence of bytes from the current stream and advances the current position within this stream by the number of bytes written.

Declaration
public void Read(IntPtr buffer, int offset, int count)
Parameters
Type Name Description
IntPtr buffer

An array of bytes. This method copies count bytes from buffer to the current stream.

int offset

The zero-based byte offset in buffer at which to begin copying bytes to the current stream.

int count

The number of bytes to be written to the current stream.