本文整理汇总了C#中Lucene.Net.Store.IndexInput.ReadVLong方法的典型用法代码示例。如果您正苦于以下问题:C# Lucene.Net.Store.IndexInput.ReadVLong方法的具体用法?C# Lucene.Net.Store.IndexInput.ReadVLong怎么用?C# Lucene.Net.Store.IndexInput.ReadVLong使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Lucene.Net.Store.IndexInput
的用法示例。
在下文中一共展示了Lucene.Net.Store.IndexInput.ReadVLong方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ReadNumericEntry
internal static NumericEntry ReadNumericEntry(IndexInput meta)
{
NumericEntry entry = new NumericEntry();
entry.Format = meta.ReadVInt();
entry.MissingOffset = meta.ReadLong();
entry.PackedIntsVersion = meta.ReadVInt();
entry.Offset = meta.ReadLong();
entry.Count = meta.ReadVLong();
entry.BlockSize = meta.ReadVInt();
switch (entry.Format)
{
case Lucene45DocValuesConsumer.GCD_COMPRESSED:
entry.MinValue = meta.ReadLong();
entry.Gcd = meta.ReadLong();
break;
case Lucene45DocValuesConsumer.TABLE_COMPRESSED:
if (entry.Count > int.MaxValue)
{
throw new Exception("Cannot use TABLE_COMPRESSED with more than MAX_VALUE values, input=" + meta);
}
int uniqueValues = meta.ReadVInt();
if (uniqueValues > 256)
{
throw new Exception("TABLE_COMPRESSED cannot have more than 256 distinct values, input=" + meta);
}
entry.Table = new long[uniqueValues];
for (int i = 0; i < uniqueValues; ++i)
{
entry.Table[i] = meta.ReadLong();
}
break;
case Lucene45DocValuesConsumer.DELTA_COMPRESSED:
break;
default:
throw new Exception("Unknown format: " + entry.Format + ", input=" + meta);
}
return entry;
}
示例2: CompressingStoredFieldsIndexReader
internal readonly PackedInts.Reader[] StartPointersDeltas; // delta from the avg
#endregion Fields
#region Constructors
// It is the responsibility of the caller to close fieldsIndexIn after this constructor
// has been called
internal CompressingStoredFieldsIndexReader(IndexInput fieldsIndexIn, SegmentInfo si)
{
MaxDoc = si.DocCount;
int[] docBases = new int[16];
long[] startPointers = new long[16];
int[] avgChunkDocs = new int[16];
long[] avgChunkSizes = new long[16];
PackedInts.Reader[] docBasesDeltas = new PackedInts.Reader[16];
PackedInts.Reader[] startPointersDeltas = new PackedInts.Reader[16];
int packedIntsVersion = fieldsIndexIn.ReadVInt();
int blockCount = 0;
for (; ; )
{
int numChunks = fieldsIndexIn.ReadVInt();
if (numChunks == 0)
{
break;
}
if (blockCount == docBases.Length)
{
int newSize = ArrayUtil.Oversize(blockCount + 1, 8);
docBases = Arrays.CopyOf(docBases, newSize);
startPointers = Arrays.CopyOf(startPointers, newSize);
avgChunkDocs = Arrays.CopyOf(avgChunkDocs, newSize);
avgChunkSizes = Arrays.CopyOf(avgChunkSizes, newSize);
docBasesDeltas = Arrays.CopyOf(docBasesDeltas, newSize);
startPointersDeltas = Arrays.CopyOf(startPointersDeltas, newSize);
}
// doc bases
docBases[blockCount] = fieldsIndexIn.ReadVInt();
avgChunkDocs[blockCount] = fieldsIndexIn.ReadVInt();
int bitsPerDocBase = fieldsIndexIn.ReadVInt();
if (bitsPerDocBase > 32)
{
throw new CorruptIndexException("Corrupted bitsPerDocBase (resource=" + fieldsIndexIn + ")");
}
docBasesDeltas[blockCount] = PackedInts.GetReaderNoHeader(fieldsIndexIn, PackedInts.Format.PACKED, packedIntsVersion, numChunks, bitsPerDocBase);
// start pointers
startPointers[blockCount] = fieldsIndexIn.ReadVLong();
avgChunkSizes[blockCount] = fieldsIndexIn.ReadVLong();
int bitsPerStartPointer = fieldsIndexIn.ReadVInt();
if (bitsPerStartPointer > 64)
{
throw new CorruptIndexException("Corrupted bitsPerStartPointer (resource=" + fieldsIndexIn + ")");
}
startPointersDeltas[blockCount] = PackedInts.GetReaderNoHeader(fieldsIndexIn, PackedInts.Format.PACKED, packedIntsVersion, numChunks, bitsPerStartPointer);
++blockCount;
}
this.DocBases = Arrays.CopyOf(docBases, blockCount);
this.StartPointers = Arrays.CopyOf(startPointers, blockCount);
this.AvgChunkDocs = Arrays.CopyOf(avgChunkDocs, blockCount);
this.AvgChunkSizes = Arrays.CopyOf(avgChunkSizes, blockCount);
this.DocBasesDeltas = Arrays.CopyOf(docBasesDeltas, blockCount);
this.StartPointersDeltas = Arrays.CopyOf(startPointersDeltas, blockCount);
}
示例3: ReadBinaryEntry
internal static BinaryEntry ReadBinaryEntry(IndexInput meta)
{
BinaryEntry entry = new BinaryEntry();
entry.Format = meta.ReadVInt();
entry.MissingOffset = meta.ReadLong();
entry.MinLength = meta.ReadVInt();
entry.MaxLength = meta.ReadVInt();
entry.Count = meta.ReadVLong();
entry.Offset = meta.ReadLong();
switch (entry.Format)
{
case Lucene45DocValuesConsumer.BINARY_FIXED_UNCOMPRESSED:
break;
case Lucene45DocValuesConsumer.BINARY_PREFIX_COMPRESSED:
entry.AddressInterval = meta.ReadVInt();
entry.AddressesOffset = meta.ReadLong();
entry.PackedIntsVersion = meta.ReadVInt();
entry.BlockSize = meta.ReadVInt();
break;
case Lucene45DocValuesConsumer.BINARY_VARIABLE_UNCOMPRESSED:
entry.AddressesOffset = meta.ReadLong();
entry.PackedIntsVersion = meta.ReadVInt();
entry.BlockSize = meta.ReadVInt();
break;
default:
throw new Exception("Unknown format: " + entry.Format + ", input=" + meta);
}
return entry;
}