DataSource
This class represents an abstract data source object.
Read from the source but do not modify the internal offset. Consecutive calls to peek() will return portions of the source starting at the same position.
ubyte* output | the ubyte array to write the output to |
size_t length | the length of the ubyte array out |
size_t peek_offset | the offset into the stream to read at |
Test whether the source still has data that can be read.
Read one ubyte.
ubyte output | the ubyte to read to |
Peek at one ubyte.
ubyte output | an output ubyte |
Discard the next N bytes of the data
size_t n | the number of bytes to discard |
This class represents a Memory-Based DataSource
Construct a memory source that reads from a string
string input | the string to read from |
Construct a memory source that reads from a ubyte array
const(ubyte)* input | the ubyte array to read from |
size_t length | the length of the ubyte array |
Construct a memory source that reads from a referenced vector
RefCounted!(Vector!(T, ALLOC), ALLOC) input | the MemoryRegion to read from |
Construct a memory source that reads from a vector
Vector!(T, ALLOC) input | the MemoryRegion to read from |
Construct a memory source that reads from a vector*
Vector!(T, ALLOC)* input | the MemoryRegion to read from |
This class represents a Stream-Based DataSource.
Construct a Stream-Based DataSource from file
string path | the name of the file |
bool use_binary | whether to treat the file as binary or not |