public static void writeInt ( int num , DataOutput out ) throws IOException { if ( num == 0 ) { out . write ( 0 ) ; return ; } final byte bytes_needed = bytesRequiredFor ( num ) ; out . write ( bytes_needed ) ; for ( int i = 0 ; i < bytes_needed ; i ++ ) out . write ( getByteAt ( num , i ) ) ; }
Writes an int to an output stream