question: static public int packLong ( DataOutput os , long value ) throws IOException { if ( value < 0 ) { throw new IllegalArgumentException ( "negative value: v=" + value ) ; } int i = 1 ; while ( ( value & ~ 0x7FL ) != 0 ) { os . write ( ( ( ( int ) value & 0x7F ) | 0x80 ) ) ; value >>>= 7 ; i ++ ; } os . write ( ( byte ) value ) ; return i ; }
target:  Pack non-negative long into output stream. It will occupy 1-10 bytes depending on value (lower values occupy smaller space)