add toBuffer & little_endian support