On Wednesday, 16 May 2012 at 18:47:55 UTC, Jonathan M Davis wrote:
As long as you're going from big endian to little endian,
std.bitmanip.bigEndianToNative will do the conversion fairly easily, but if they're in little endian, then the nasty casting is the way to go.

- Jonathan M Davis

Except they don't take slices. You need a helper function.

ubyte[2] _2(ubyte[] a){ubyte[2] b; assert(a.length==2); b[]=a; return b;}

Reply via email to