예제 #1
0
        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);
        }
예제 #2
0
        public override void Close()
        {
            if (_locked)
            {
                _archive.ReleaseLock();
                _locked = false;
            }

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

            Flush();
            base.Close();
        }