Here you can find the source of readPackedLong(ByteBuffer input)
public static long readPackedLong(ByteBuffer input)
//package com.java2s; //License from project: Open Source License import java.nio.ByteBuffer; public class Main { public static long readPackedLong(ByteBuffer input) { long result = 0; long read; long index = 0; do {//from w w w. j a va 2 s. c o m read = input.get() & 0xFF; result += (read & 127) << index; index += 7; } while (read > 127); assert result >= 0; return result; } }