Stream.readToBuffer

Reads bytes from the stream into a buffer.

class Stream
abstract
ubyte[]
readToBuffer
(
scope ref ubyte[] buffer
)

Parameters

buffer ubyte[]

The buffer to read into, the length of the buffer determines how many bytes to read.

Return Value

Type: ubyte[]

A slice of buffer, specifying which portion of it has been filled with data. The length of this slice is also how to check how many bytes were read in.

Throws

StreamCannotReadException if this stream does not support reading. StreamDisposedException if this stream has been disposed of.

Meta