public override int Read(byte[] buffer, int offset, int count)
        {
            _archive.AcquireLock();
            int result = 0;

            if (_write == false)
            {
                _archive.Stream.Seek(_offset + Position, SeekOrigin.Begin);
                if (count > (Length - Position))
                {
                    count = (int)(Length - Position);
                }

                result    = _archive.Stream.Read(buffer, offset, count);
                Position += result;
            }
            else
            {
                result    = _entry.OutstandingWriteStream.Read(buffer, offset, count);
                Position += result;
            }
            _archive.ReleaseLock();

            return(result);
        }
Example #2
0
        public override void Close()
        {
            if (_locked)
            {
                _archive.ReleaseLock();
                _locked = false;
            }

            base.Close();
        }
Example #3
0
        public override void Close()
        {
            if (_locked)
            {
                _archive.ReleaseLock();
                _locked = false;
                _entry.CurrentlyOpenForWrite = false;
            }

            Flush();
            base.Close();
        }