public static void writeUnsignedShort(byte[] bytes, int value, int offset) {
        bytes[offset] = (byte) (0xFF & (value >> 8));
        bytes[offset + 1] = (byte) (0xFF & value);
    }
public static void writeUnsignedShort ( byte [ ] bytes , int value , int offset ) { bytes [ offset ] = ( byte ) ( 0xFF & ( value > > 8 ) ) ; bytes [ offset + 1 ] = ( byte ) ( 0xFF & value ) ; }
Write an unsigned short to the byte array starting at the given offset

@param bytes The byte array
@param value The short to write
@param offset The offset to begin writing at