public static void writeIntToByteArray ( byte [ ] buf , int offset , int value ) { buf [ offset ++ ] = ( byte ) ( value & 0x000000ff ) ; buf [ offset ++ ] = ( byte ) ( ( value & 0x0000ff00 ) >> 8 ) ; buf [ offset ++ ] = ( byte ) ( ( value & 0x00ff0000 ) >> 16 ) ; buf [ offset ] = ( byte ) ( ( value & 0xff000000 ) >> 24 ) ; }
Outputs an int into a byte array .