当前位置: 首页>>代码示例>>C#>>正文


C# IndexInput.ReadInt方法代码示例

本文整理汇总了C#中Lucene.Net.Store.IndexInput.ReadInt方法的典型用法代码示例。如果您正苦于以下问题:C# IndexInput.ReadInt方法的具体用法?C# IndexInput.ReadInt怎么用?C# IndexInput.ReadInt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Lucene.Net.Store.IndexInput的用法示例。


在下文中一共展示了IndexInput.ReadInt方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: MonotonicBlockPackedReader

 /// <summary>
 /// Sole constructor. </summary>
 public MonotonicBlockPackedReader(IndexInput @in, int packedIntsVersion, int blockSize, long valueCount, bool direct)
 {
     this.ValueCount = valueCount;
     BlockShift = PackedInts.CheckBlockSize(blockSize, AbstractBlockPackedWriter.MIN_BLOCK_SIZE, AbstractBlockPackedWriter.MAX_BLOCK_SIZE);
     BlockMask = blockSize - 1;
     int numBlocks = PackedInts.NumBlocks(valueCount, blockSize);
     MinValues = new long[numBlocks];
     Averages = new float[numBlocks];
     SubReaders = new PackedInts.Reader[numBlocks];
     for (int i = 0; i < numBlocks; ++i)
     {
         MinValues[i] = @in.ReadVLong();
         Averages[i] = Number.IntBitsToFloat(@in.ReadInt());
         int bitsPerValue = @in.ReadVInt();
         if (bitsPerValue > 64)
         {
             throw new Exception("Corrupted");
         }
         if (bitsPerValue == 0)
         {
             SubReaders[i] = new PackedInts.NullReader(blockSize);
         }
         else
         {
             int size = (int)Math.Min(blockSize, valueCount - (long)i * blockSize);
             if (direct)
             {
                 long pointer = @in.FilePointer;
                 SubReaders[i] = PackedInts.GetDirectReaderNoHeader(@in, PackedInts.Format.PACKED, packedIntsVersion, size, bitsPerValue);
                 @in.Seek(pointer + PackedInts.Format.PACKED.ByteCount(packedIntsVersion, size, bitsPerValue));
             }
             else
             {
                 SubReaders[i] = PackedInts.GetReaderNoHeader(@in, PackedInts.Format.PACKED, packedIntsVersion, size, bitsPerValue);
             }
         }
     }
 }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:40,代码来源:MonotonicBlockPackedReader.cs

示例2: ReadBinaryEntry

        private BinaryEntry ReadBinaryEntry(IndexInput meta)
        {
            var entry = new BinaryEntry();
            entry.offset = meta.ReadLong();
            entry.numBytes = meta.ReadInt();
            entry.count = meta.ReadInt();
            entry.missingOffset = meta.ReadLong();
            if (entry.missingOffset != -1)
            {
                entry.missingBytes = meta.ReadLong();
            }
            else
            {
                entry.missingBytes = 0;
            }

            return entry;
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:18,代码来源:DirectDocValuesProducer.cs

示例3: ReadNumericEntry

        private static NumericEntry ReadNumericEntry(IndexInput meta)
        {
            var entry = new NumericEntry { offset = meta.ReadLong(), count = meta.ReadInt(), missingOffset = meta.ReadLong() };
            if (entry.missingOffset != -1)
            {
                entry.missingBytes = meta.ReadLong();
            }
            else
            {
                entry.missingBytes = 0;
            }
            entry.byteWidth = meta.ReadByte();

            return entry;
        }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:15,代码来源:DirectDocValuesProducer.cs

示例4: VariableIntBlockIndexInput

 protected internal VariableIntBlockIndexInput(IndexInput input)
 {
     this.input = input;
     maxBlockSize = input.ReadInt();
 }
开发者ID:ChristopherHaws,项目名称:lucenenet,代码行数:5,代码来源:VariableIntBlockIndexInput.cs

示例5: ValidateFooter

        private static void ValidateFooter(IndexInput @in)
        {
            int magic = @in.ReadInt();
            if (magic != FOOTER_MAGIC)
            {
                throw new System.IO.IOException("codec footer mismatch: actual footer=" + magic + " vs expected footer=" + FOOTER_MAGIC + " (resource: " + @in + ")");
            }

            int algorithmID = @in.ReadInt();
            if (algorithmID != 0)
            {
                throw new System.IO.IOException("codec footer mismatch: unknown algorithmID: " + algorithmID);
            }
        }
开发者ID:Cefa68000,项目名称:lucenenet,代码行数:14,代码来源:CodecUtil.cs


注:本文中的Lucene.Net.Store.IndexInput.ReadInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。