Lucene.Net.Util.Fst.BytesStore.BytesStore C# (CSharp) Method

BytesStore() public method

Pulls bytes from the provided IndexInput.
public BytesStore ( DataInput @in, long numBytes, int maxBlockSize ) : System
@in DataInput
numBytes long
maxBlockSize int
return System
        public BytesStore(DataInput @in, long numBytes, int maxBlockSize)
        {
            int blockSize = 2;
            int blockBits = 1;
            while (blockSize < numBytes && blockSize < maxBlockSize)
            {
                blockSize *= 2;
                blockBits++;
            }
            this.blockBits = blockBits;
            this.blockSize = blockSize;
            this.blockMask = blockSize - 1;
            long left = numBytes;
            while (left > 0)
            {
                int chunk = (int)Math.Min(blockSize, left);
                byte[] block = new byte[chunk];
                @in.ReadBytes(block, 0, block.Length);
                blocks.Add(block);
                left -= chunk;
            }

            // So .getPosition still works
            nextWrite = blocks[blocks.Count - 1].Length;
        }

Same methods

BytesStore::BytesStore ( int blockBits ) : System