AtomicStream

Thread-safe implementation of BinaryStream.

Constructors

this
this(T data, Endianness endianness)
Undocumented in source.

Members

Functions

mayRead
bool mayRead()

Checks if there are enough elements left in the data array to read T.

mayRead
bool mayRead(size_t size)

Checks if there are enough elements left in the data array to read.

peek
T peek()

Peeks at the next value from the stream of type T without advancing the stream position.

peek
T[] peek(size_t count)

Peeks at multiple values of type T from the stream without advancing the stream position.

peek
T peek()

Peeks an array of type T from the stream without advancing the stream position.

peekString
immutable(CHAR)[] peekString()

Reads a string from the stream considering the character width and prefixing without advancing the stream position.

put
void put(T val)

Writes the provided value to the stream without advancing the stream position.

put
void put(T val)

Writes multiple values of type T to the stream without advancing the stream position.

putString
void putString(immutable(CHAR)[] val)

Writes a string into the stream considering the character width and prefixing without advancing the stream position.

read
T read()

Reads the next value from the stream of type T.

read
T[] read(size_t count)

Reads multiple values of type T from the stream.

read
T read()

Reads an array of type T from the stream.

read
T read()

Reads data from a byte stream into a structured type based on specified field names and read kinds. Designed specifically for better control reading string and array fields.

read7EncodedInt
uint read7EncodedInt()

Reads an integer value encoded in 7 bits from the stream.

readPlasticized
T readPlasticized()

Reads a type from the stream using optional fields.

readString
immutable(CHAR)[] readString()

Reads a string from the stream considering the character width and prefixing.

seek
void seek(size_t offset)

Seeks to a new position in the stream based on the provided offset and seek direction.

step
void step(size_t count)

Moves the position in the stream by the size of type T.

stepUntil
void stepUntil(T val)

Moves the position in the stream forward by one until val is peeked.

write
void write(T val)

Writes the provided value to the stream.

write
void write(T val)

Writes multiple values of type T to the stream.

write7EncodedInt
void write7EncodedInt(uint val)

Writes an integer value encoded in 7 bits to the stream.

writeString
void writeString(immutable(CHAR)[] val)

Writes a string to the stream considering the character width and prefixing.

Variables

data
Atomic!(ubyte[]) data;
Undocumented in source.
endianness
Atomic!Endianness endianness;
Undocumented in source.
position
Atomic!size_t position;
Undocumented in source.

Meta