digitalmars.D.learn - ubyte array to uint?
Is there a simple way of conversion? Something like: uint length = to!uint(buffer[0 .. 4]); Right now I have: uint length = *cast(uint*)buffer[0 .. 4].ptr; Which I'm not entirely sure is the correct way to do that.
Feb 05 2015
On Friday, 6 February 2015 at 05:18:45 UTC, Gan wrote:Is there a simple way of conversion? Something like: uint length = to!uint(buffer[0 .. 4]); Right now I have: uint length = *cast(uint*)buffer[0 .. 4].ptr; Which I'm not entirely sure is the correct way to do that.Hi, check out std.bitmanip.read
Feb 05 2015