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); }
public BigArchiveEntryStream(BigArchiveEntry entry, uint offset) { _entry = entry; _archive = entry.Archive; _offset = offset; _archive.AcquireLock(); _locked = true; }