Example #1
0
        /// <summary>
        /// Read from the underlying stream, returning actual length read.
        /// </summary>
        public override int Read(byte[] buffer, int offset, int count)
        {
            var total = _pushbackBuffer.Read(buffer, offset, count);

            _position += total;
            return(total);
        }
 /// <summary>
 /// Read bytes from stream, reading and joining chunks as needed.
 /// </summary>
 public override int Read(byte[] buffer, int offset, int count)
 {
     if (count > _buffer.Available() && !_complete)
     {
         var more = ReadNextChunk();
         _buffer.UnRead(more, 0, more.Length);
     }
     return(_buffer.Read(buffer, offset, count));
 }