Reader

Helper container that manages changing position in the mmapped database file. It automatically handles moving the internal pointer forward when data is read to ensure proper alignment of data.

Constructors

this
this(ubyte[] data, size_t startOffset = 0)

Constructs a new reader from a slice and a starting offset

Members

Functions

newReader
Reader newReader(size_t offset)

Creates a new reader at a different offset: used by the pointer and cache types to go fetch data outside of their own location.

read
ubyte[] read(size_t length)

Reads $length bytes from the database

read
T read(size_t length)

Reads $length bytes from the database and convert it to a native type of the appropriate endianness

read
T read(size_t length, T extrabits)

Reads $length byte into an integer type with the appropriate endianness and append extra most significant bits

read
ubyte read()

Reads a single byte from the database

Variables

current
size_t current;

Pointer to the current offset in the database file

data
ubyte[] data;

The raw slice of the whole database

Meta