ByteBuffer

Class warp a ubyte[] to provide byte handle.

Constructors

this
this()
Undocumented in source.
this
this(ubyte[] buffer)

init ByteBuffer obj with buffer data

Members

Functions

get
T get(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
get
T get(size_t index)
Undocumented in source. Be warned that the author may not have intended to support it.
get
T get(size_t index)

get Byte value in buffer from index

put
void put(size_t offset, T value)

put boolen value into buffer

put
void put(size_t offset, T value)

put byte value into buffer

put
void put(size_t offset, T value)

put numbirc value into buffer

restData
void restData(ubyte[] buffer, size_t pos)
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

data
ubyte[] data [@property getter]

Returns buffer data

length
size_t length [@property getter]

Returns buffer length

position
size_t position [@property getter]

Returns buffer position

Examples

test for boolen value

ByteBuffer buf = new ByteBuffer(new ubyte[50]);
bool a = true;
buf.put(5, a);
bool b = false;
buf.put(9, b);
assert(buf.get!bool(5) == true);
assert(buf.get!bool(9) == false);

Meta