Read Byte Array to Integer

Jeroen Bollen jbinero at gmail.com
Fri Nov 22 14:55:25 PST 2013


On Friday, 22 November 2013 at 21:17:56 UTC, monarch_dodra wrote:
> On Friday, 22 November 2013 at 19:44:56 UTC, Jeroen Bollen 
> wrote:
>> On Friday, 22 November 2013 at 19:22:16 UTC, Ali Çehreli wrote:
>>> import std.bitmanip;
>>> import std.system;
>>>
>>> void main()
>>> {
>>>   ubyte[] data = [ 1, 2, 3, 4 ];
>>>   assert(data.read!(uint, Endian.littleEndian) == 0x04030201);
>>> }
>>>
>>> Ali
>>
>> I have std.system included... :s
>
> What is the type of your "data"?

immutable ubyte[]


More information about the Digitalmars-d-learn mailing list