static private GetValue ( Lucene.Net.Index.BinaryDocValues bdv, int idx, BytesRef scratch ) : long | ||
bdv | Lucene.Net.Index.BinaryDocValues | |
idx | int | |
scratch | BytesRef | |
리턴 | long |
internal static long GetValue(BinaryDocValues bdv, int idx, BytesRef scratch)
{
bdv.Get(idx, scratch);
idx = scratch.Offset;
var b = scratch.Bytes[idx++];
long value = b & 0x7FL;
for (int shift = 7; (b & 0x80L) != 0; shift += 7)
{
b = scratch.Bytes[idx++];
value |= (b & 0x7FL) << shift;
}
return value;
}