public static byte[] writeUnsignedShort(int s){
  ByteBuffer bb=ByteBuffer.allocate(2);
  bb.put((byte)((s >> 8) & 0xff));
  bb.put((byte)(s & 0xff));
  return bb.array();
}

public static byte [ ] writeUnsignedShort ( int s ) { ByteBuffer bb = ByteBuffer . allocate ( 2 ) ; bb . put ( ( byte ) ( ( s > > 8 ) & 0xff ) ) ; bb . put ( ( byte ) ( s & 0xff ) ) ; return bb . array ( ) ; }
writes an unsigned 16 bit big - endian number .
