Read Byte Array to Integer

Ali Çehreli acehreli at yahoo.com
Sat Nov 23 08:43:47 PST 2013


On 11/23/2013 08:36 AM, Jeroen Bollen wrote:

 > So if I have a byte array [0, 0, 1, 0], and I read a ushort from it
 > twice, I will get this?
 >
 > ubyte[] arr = [0, 0, 1, 0];
 > arr.read!(ushort, Endian.littleEndian); // == 0
 > arr.read!(ushort, Endian.littleEndian); // == 1
 > arr.length; // == 0

Yes, that's the idea.

Ali



More information about the Digitalmars-d-learn mailing list