(ArcFile.OpenSeekableEntry): new public method.

This commit is contained in:
morkt 2015-06-02 22:53:20 +04:00
parent 56e1116971
commit 7f4b01b7ca

View File

@ -143,6 +143,22 @@ namespace GameRes
return m_interface.OpenEntry (this, entry);
}
/// <summary>
/// Open specified <paramref name="entry"/> as a seekable Stream.
/// </summary>
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;
}
}
/// <summary>
/// Create file corresponding to <paramref name="entry"/> within current directory and open
/// it for writing.