mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-23 21:55:34 +08:00
(ArcFile.OpenSeekableEntry): new public method.
This commit is contained in:
parent
56e1116971
commit
7f4b01b7ca
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user