I find this solution :
const SIZEOF_INT32 = 4
var cbuffer = make([]byte, 28)
var hbuffer = make([]uint32, len(cbuffer)/SIZEOF_INT32)
for i := range hbuffer {
hbuffer[i] = uint32(binary.LittleEndian.Uint32(cbuffer[i*SIZEOF_INT32
: (i+1)*SIZEOF_INT32]))
}
By default, I specifying the endianness LittleEndian
but I do not know how to findi the native byte order,
--
You received this message because you are subscribed to the Google Groups
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.