question: public static void writeUnsignedVL ( long data , DataOutput out ) throws IOException { while ( true ) { if ( ( data & ~ 0x7FL ) == 0 ) { out . writeByte ( ( int ) data ) ; return ; } else { out . writeByte ( ( ( int ) data & 0x7F ) | 0x80 ) ; data >>>= 7 ; } } }
target:  Encode a long as a variable length array. This method is appropriate for unsigned integers. For signed integers, negative values will always consume 10 bytes, so it is recommended to use writeSignedVL instead. This is taken from the varint encoding in protobufs (BSD licensed). See https://developers.google.com/protocol-buffers/docs/encoding