/// <summary>Copy the current contents of this buffer to the named output. </summary> public virtual void WriteTo(IndexOutput out_Renamed) { Flush(); long end = file.length; long pos = 0; int buffer = 0; while (pos < end) { int length = BUFFER_SIZE; long nextPos = pos + length; if (nextPos > end) { // at the last buffer length = (int) (end - pos); } out_Renamed.WriteBytes((byte[]) file.GetBuffer(buffer++), length); pos = nextPos; } }
public ChecksumIndexOutput(IndexOutput main) { this.main = main; digest = new CRC32(); }