Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: int FillBuffer(this Stream, byte[], int, int)

Declaration

public static int FillBuffer(
    this Stream stream,
    byte[] buffer,
    int offset,
    int length
)

Summary

Attempts to fill the buffer with the specified number of bytes from the stream. If there are fewer bytes left in the stream than requested then all available bytes will be read into the buffer.

Parameters

this Streamstream Stream to read from.
byte[]buffer Buffer to write the bytes to.
intoffset Offset at which to write the first byte read from the stream.
intlength Number of bytes to read from the stream.

Returns

Number of bytes read from the stream into buffer. This may be less than requested, but only if the stream ended before the required number of bytes were read.