public override int Read(byte[] buffer, int offset, int count) { int read = 0; while(count > 0 && _bufferIndex < _buffers.Count) { int toRead = Math.Min(count, _buffer.End - _offset); Array.Copy(_buffer.Buffer, _offset, buffer, offset, toRead); count -= toRead; read += toRead; offset += toRead; _offset += toRead; if (count > 0 && !_nextBuffer()) break; } return read; }