BinaryWriter

Writes binary data.

To write data to buffer, use write or put function.

Constructors

this
this(ByteOrder byteOrder)

Creates instance of BinaryWriter

Members

Aliases

put
alias put = write

Alias to write.

Functions

clear
void clear()

Clears buffer and resets current position.

fill
void fill(size_t times, ubyte value = 0)

Fills value specified number of times.

padFill
void padFill(size_t offset, ubyte value = 0)

Moves cursor to specified position filling stream with zeros if necessary.

position
size_t position()

Current position in buffer.

position
void position(size_t newpos)

Sets new position in buffer.

write
void write(T value)

Writes value to buffer.

write
void write(T values)

Writes values to buffer.

writeArray
void writeArray(T[] array)

Writes array to buffer.

writeString
void writeString(T str)

Writes str to buffer.

Variables

buffer
ubyte[] buffer;

Buffer with binary encoded data.

byteOrder
ByteOrder byteOrder;

Byte orded used

Meta