BinaryReader: Read

Read

Fills either a Byte array or Integer array with the specified number of elements. Or returns the next character to be decoded from the stream.

 Public Function Read(
	  Optional ByRef Buffer As Variant,
	  Optional ByRef Index As Variant,
	  Optional ByRef Count As Variant ) As Long

Parameters

Buffer
[ByRef] Optional. Variant. The array to write the data to.
Index
[ByRef] Optional. Variant. The first index in Buffer to start writing data.
Count
[ByRef] Optional. Variant. The number of elements to be written to the array.

Return Values

Long -  The actual number of elements written to the array. This could be less than the requested amount.

Remarks

If a Byte array is passed in, then the bytes from the underlying stream are copied to the array. If an Integer array is passed in, then enough bytes are read from the stream to produce the requested number of decoded characters. The decoded characters are placed in the array starting at Index.

If all parameters are missing then a single character will be decoded from the stream and returned.

All parameters must either be missing or supplied or an exception is thrown.

See Also

Project VBCorLib Overview | Class BinaryReader Overview