public static void writeUnsignedLong ( byte [ ] bytes , int offset , long i ) { while ( ( i & ~ 0x7F ) != 0 ) { bytes [ offset ++ ] = ( byte ) ( ( i & 0x7f ) | 0x80 ) ; i >>>= 7 ; } bytes [ offset ] = ( byte ) i ; }
Writes an int in a variable - length format . Writes between one and nine bytes . Smaller values take fewer bytes . Negative numbers are not supported .