support little endian buffer