diff --git a/GameRes/ArcFile.cs b/GameRes/ArcFile.cs index 80957ac8..59633b79 100644 --- a/GameRes/ArcFile.cs +++ b/GameRes/ArcFile.cs @@ -143,6 +143,22 @@ namespace GameRes return m_interface.OpenEntry (this, entry); } + /// + /// Open specified as a seekable Stream. + /// + public Stream OpenSeekableEntry (Entry entry) + { + var input = OpenEntry (entry); + if (input.CanSeek) + return input; + using (input) + { + var copy = new MemoryStream ((int)entry.Size); + input.CopyTo (copy); + return copy; + } + } + /// /// Create file corresponding to within current directory and open /// it for writing.