Esempio n. 1
0
        internal ByteBufferIndexInput(string resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, bool trackClones)
            : base(resourceDescription)
        {
            this.buffers        = buffers;
            this.Length_Renamed = length;
            this.ChunkSizePower = chunkSizePower;
            this.ChunkSizeMask  = (1L << chunkSizePower) - 1L;
            this.Clones         = trackClones ? WeakIdentityMap <ByteBufferIndexInput, BoolRefWrapper> .NewConcurrentHashMap() : null;

            Debug.Assert(chunkSizePower >= 0 && chunkSizePower <= 30);
            //assert((long)((ulong)length >> chunkSizePower)) < int.MaxValue;

            //Seek(0L);
        }
Esempio n. 2
0
        internal ByteBufferIndexInput(string resourceDescription, ByteBuffer[] buffers, long length, int chunkSizePower, bool trackClones)
            : base(resourceDescription)
        {
            //this.buffers = buffers; // LUCENENET: this is set in SetBuffers()
            this.length         = length;
            this.chunkSizePower = chunkSizePower;
            this.chunkSizeMask  = (1L << chunkSizePower) - 1L;
            this.clones         = trackClones ? WeakIdentityMap <ByteBufferIndexInput, BoolRefWrapper> .NewConcurrentHashMap() : null;

            Debug.Assert(chunkSizePower >= 0 && chunkSizePower <= 30);
            Debug.Assert(((long)((ulong)length >> chunkSizePower)) < int.MaxValue);

            // LUCENENET specific: MMapIndexInput calls SetBuffers() to populate
            // the buffers, so we need to skip that call if it is null here, and
            // do the seek inside SetBuffers()
            if (buffers != null)
            {
                SetBuffers(buffers);
            }
        }