internal MMapIndexInput(MMapDirectory enclosingInstance, System.IO.FileStream raf) { byte[] data = new byte[raf.Length]; raf.Read(data, 0, (int)raf.Length); InitBlock(enclosingInstance); this.length = raf.Length; this.buffer = new System.IO.MemoryStream(data); }
public MultiMMapIndexInput(MMapDirectory enclosingInstance, System.IO.FileStream raf, int maxBufSize) { InitBlock(enclosingInstance); this.length = raf.Length; this.maxBufSize = maxBufSize; if (maxBufSize <= 0) { throw new System.ArgumentException("Non positive maxBufSize: " + maxBufSize); } if ((length / maxBufSize) > System.Int32.MaxValue) { throw new System.ArgumentException("RandomAccessFile too big for maximum buffer size: " + raf.ToString()); } int nrBuffers = (int)(length / maxBufSize); if (((long)nrBuffers * maxBufSize) < length) { nrBuffers++; } this.buffers = new System.IO.MemoryStream[nrBuffers]; this.bufSizes = new int[nrBuffers]; long bufferStart = 0; System.IO.FileStream rafc = raf; for (int bufNr = 0; bufNr < nrBuffers; bufNr++) { byte[] data = new byte[rafc.Length]; raf.Read(data, 0, (int)rafc.Length); int bufSize = (length > (bufferStart + maxBufSize))?maxBufSize:(int)(length - bufferStart); this.buffers[bufNr] = new System.IO.MemoryStream(data); this.bufSizes[bufNr] = bufSize; bufferStart += bufSize; } Seek(0L); }
private void InitBlock(byte[] buffer, MMapDirectory enclosingInstance) { this.buffer = buffer; this.enclosingInstance = enclosingInstance; }
public AnonymousClassPrivilegedExceptionAction(byte[] buffer, MMapDirectory enclosingInstance) { InitBlock(buffer, enclosingInstance); }
public MultiMMapIndexInput(MMapDirectory enclosingInstance, System.IO.FileStream raf, int maxBufSize) { InitBlock(enclosingInstance); this.length = raf.Length; this.maxBufSize = maxBufSize; if (maxBufSize <= 0) throw new System.ArgumentException("Non positive maxBufSize: " + maxBufSize); if ((length / maxBufSize) > System.Int32.MaxValue) { throw new System.ArgumentException("RandomAccessFile too big for maximum buffer size: " + raf.ToString()); } int nrBuffers = (int) (length / maxBufSize); if (((long) nrBuffers * maxBufSize) < length) nrBuffers++; this.buffers = new System.IO.MemoryStream[nrBuffers]; this.bufSizes = new int[nrBuffers]; long bufferStart = 0; System.IO.FileStream rafc = raf; for (int bufNr = 0; bufNr < nrBuffers; bufNr++) { byte[] data = new byte[rafc.Length]; raf.Read(data, 0, (int) rafc.Length); int bufSize = (length > (bufferStart + maxBufSize))?maxBufSize:(int) (length - bufferStart); this.buffers[bufNr] = new System.IO.MemoryStream(data); this.bufSizes[bufNr] = bufSize; bufferStart += bufSize; } Seek(0L); }
private void InitBlock(MMapDirectory enclosingInstance) { this.enclosingInstance = enclosingInstance; }
internal MMapIndexInput(MMapDirectory enclosingInstance, System.IO.FileStream raf) { byte[] data = new byte[raf.Length]; raf.Read(data, 0, (int) raf.Length); InitBlock(enclosingInstance); this.length = raf.Length; this.buffer = new System.IO.MemoryStream(data); }
private void InitBlock(byte[] buffer, MMapDirectory enclosingInstance) { this.buffer = buffer; this.enclosingInstance = enclosingInstance; }
public AnonymousClassPrivilegedExceptionAction(byte[] buffer, MMapDirectory enclosingInstance) { InitBlock(buffer, enclosingInstance); }
private void InitBlock(MMapDirectory enclosingInstance) { this.enclosingInstance = enclosingInstance; }