Example #1
0
        // Functions

        /// <summary>
        /// Close the stream
        /// </summary>
        public override void Close()
        {
            Flush();
            Underlier.Close();
            _pos    = 0;
            _buffer = null;
        }
        // Functions

        /// <summary>
        /// Close the stream
        /// </summary>
        public override void Close()
        {
            Underlier.Close();
            _size   = 0;
            _pos    = 0;
            _buffer = null;
        }
        // Functions

        /// <summary>
        /// Close the stream
        /// </summary>
        public override void Close()
        {
            Flush();
            Underlier.Close();
            _rpos  = 0;
            _rsize = 0;
            _wpos  = 0;
        }
Example #4
0
        /// <summary>
        /// Seek to the specified offset and origin.
        /// </summary>
        /// <param name='offset'>
        /// Offset.
        /// </param>
        /// <param name='origin'>
        /// Origin.
        /// </param>
        public override long Seek(long offset, SeekOrigin origin)
        {
            var pos = Underlier.Seek(offset, origin);

            _pos = 0;

            return(pos);
        }
Example #5
0
        /// <summary>
        /// Flush stream
        /// </summary>
        public override void Flush()
        {
            if (_pos == 0)
            {
                return;
            }

            Underlier.Write(_buffer, 0, _pos);
            _pos = 0;
        }
        private void Refill()
        {
            if (_pos < _size)
            {
                return;
            }

            _pos  = 0;
            _size = Math.Max(0, Underlier.Read(_buffer, 0, _buffer.Length));
        }
        private void Refill()
        {
            if (_rpos < _rsize)
            {
                return;
            }

            _rpos  = 0;
            _rsize = 0;

            _rsize = Underlier.Read(_rbuffer, 0, _rbuffer.Length);
        }
Example #8
0
 /// <summary>
 /// Sets the length.
 /// </summary>
 /// <param name='value'>
 /// length of file.
 /// </param>
 public override void SetLength(long value)
 {
     Underlier.SetLength(value);
 }