public static byte [ ] intToUInt32 ( int i , ByteOrder endian ) { int truncated = ( int ) ( ( long ) i ) ; return ByteBuffer . allocate ( 4 ) . order ( endian ) . putInt ( truncated ) . array ( ) ; }
Convert an int to a four - byte array of its representation as an unsigned byte .