question: public static void writeUINT16 ( int number , OutputStream out ) throws IOException { if ( number < 0 ) { throw new IllegalArgumentException ( "positive value expected." ) ; } byte [ ] toWrite = new byte [ 2 ] ; for ( int i = 0 ; i <= 8 ; i += 8 ) { toWrite [ i / 8 ] = ( byte ) ( ( number > > i ) & 0xFF ) ; } out . write ( toWrite ) ; }
target:  Writes the given value as UINT16 into the stream.