public static void writeShortToByteArray ( byte [ ] buf , int offset , short value ) { buf [ offset ++ ] = ( byte ) ( value & 0x000000ff ) ; buf [ offset ] = ( byte ) ( ( value & 0x0000ff00 ) >> 8 ) ; }
Outputs a short into a byte array .