/// <summary>Copy numBytes bytes from input to ourself. </summary> public virtual void CopyBytes(IndexInput input, long numBytes) { System.Diagnostics.Debug.Assert(numBytes >= 0, "numBytes=" + numBytes); long left = numBytes; if (copyBuffer == null) copyBuffer = new byte[COPY_BUFFER_SIZE]; while (left > 0) { int toCopy; if (left > COPY_BUFFER_SIZE) toCopy = COPY_BUFFER_SIZE; else toCopy = (int) left; input.ReadBytes(copyBuffer, 0, toCopy); WriteBytes(copyBuffer, 0, toCopy); left -= toCopy; } }
public ChecksumIndexInput(IndexInput main) { this.main = main; digest = new SupportClass.CRC32(); }