示例#1
0
 /// <summary>
 /// Constructs a new multi buffer stream instance
 /// </summary>
 /// <param name="buffers"></param>
 public MultiBufferStream(List<BufferSegment> buffers)
 {
     _buffers = buffers;
     _bufferIndex = 0;
     if (_buffers.Count > 0)
     {
         _buffer = _buffers[0];
         _offset = _buffer.Offset;
     }
 }
示例#2
0
        /// <summary>
        /// Advances to the next buffer
        /// </summary>
        /// <returns>True if another buffer is available, false otherwise</returns>
        private bool _nextBuffer()
        {
            bool ret = false;
            _bufferIndex++;

            if(_bufferIndex < _buffers.Count)
            {
                _buffer = _buffers[_bufferIndex];
                _offset = _buffer.Offset;
                ret = true;
            }

            return ret;
        }