IO Streams
License
Boost License 1.0.
Authors
Jason White

struct  StreamShim(Stream) if (isStream!Stream);

Wraps a stream to provide useful higher-level functions.


this(T...)(auto ref T args);

Forwards arguments to super class.


size_t  read(T)(T[] buf);

Fills the given buffer with data from the stream.

Note:
This is not guaranteed to  read the entire buffer from the stream. If T.sizeof is larger than 1, it is possible that an element is partially  read. If a guarantee that the entire buffer is filled, use readExactly instead.
Returns
The number of bytes  read.

size_t  write(T)(in T[] buf);

Writes an array of type T to the stream.

Returns
The number of bytes written.
Note:
This is not guaranteed to  write the entire buffer to the stream. If T.sizeof is larger than 1, it is possible that an element may not be fully written. If the guarantee that the entire buffer is written to the stream, use writeExactly instead.