public long readVarLong ( ) throws IOException { boolean more ; long result = 0 ; do { int b = in . readUnsignedByte ( ) ; more = ( b & 0x80 ) == 0x80 ; result = 128 * result + ( b & 0x7F ) ; // TODO Check for long overflow } while ( more ) ; return result ; }
Read a simple var int up to 64 bits