D - Is there a bytebuffer for reading and writing bytes?

Viewed 314

I just started learning D today and I really need to read and write data like this:

byte[] bytes = ...;
ByteBuffer buf = new ByteBuffer(bytes);
int a = buf.getInt();
byte b = buf.getByte();
short s = buf.getShort();
buf.putInt(200000);

Is there anything built in to D that can achieve this or must I make it myself?

2 Answers
Related