Skip to content

Block Constructors ​

Overloads ​

NameDescription
Block(Header, Trailer, Int32)Initializes a new instance of the Block class with zero-filled data of the specified length.
Block(Header, Trailer, Int32, Stream)Initializes a new instance of the Block class by reading data from a stream.
Block(Header, Trailer, Int32, IEnumerable<Byte>)Initializes a new instance of the Block class from a sequence of bytes.
Block(Header, Trailer, Byte[])Initializes a new instance of the Block class from a byte array.

Block(Header, Trailer, Int32) ​

Initializes a new instance of the Block class with zero-filled data of the specified length.

c#
protected Block(Header header, Trailer trailer, int length);

View source

Parameters ​

NameTypeDescription
headerHeaderThe header for this block.
trailerTrailerThe trailer for this block.
lengthInt32The length of the block data in bytes.

Block(Header, Trailer, Int32, Stream) ​

Initializes a new instance of the Block class by reading data from a stream.

c#
protected Block(Header header, Trailer trailer, int length, Stream data);

View source

Parameters ​

NameTypeDescription
headerHeaderThe header for this block.
trailerTrailerThe trailer for this block.
lengthInt32The number of bytes to read.
dataStreamThe stream to read the block data from.

Block(Header, Trailer, Int32, IEnumerable<Byte>) ​

Initializes a new instance of the Block class from a sequence of bytes.

c#
protected Block(Header header, Trailer trailer, int length, IEnumerable<Byte> data);

View source

Parameters ​

NameTypeDescription
headerHeaderThe header for this block.
trailerTrailerThe trailer for this block.
lengthInt32The expected length of the block data in bytes.
dataIEnumerable<Byte>The bytes for this block.

Block(Header, Trailer, Byte[]) ​

Initializes a new instance of the Block class from a byte array.

c#
protected Block(Header header, Trailer trailer, Byte[] data);

View source

Parameters ​

NameTypeDescription
headerHeaderThe header for this block.
trailerTrailerThe trailer for this block.
dataByte[]The raw byte data for this block.