internal Stream OpenChunk(VpkEntry entry)
        {
            var file   = Chunks[entry.ArchiveIndex];
            var stream = OpenFile(file);
            var offset = entry.ArchiveIndex == DirectoryIndex ? HeaderLength + TreeLength + entry.EntryOffset : entry.EntryOffset;

            stream.Position = offset;
            return(stream);
        }
 public VpkEntryStream(VpkEntry entry, Stream stream)
 {
     _entry       = entry;
     _stream      = stream;
     _streamStart = stream.Position;
 }
 public VpkEntryStream(VpkEntry entry, VpkDirectory directory)
 {
     _entry       = entry;
     _stream      = directory.OpenChunk(_entry);
     _streamStart = _stream.Position;
 }