mirror of
https://github.com/lifegpc/GARbro.git
synced 2026-07-08 01:31:41 +08:00
(ArcFile.OpenSeekableEntry): new public method.
This commit is contained in:
@@ -143,6 +143,22 @@ namespace GameRes
|
|||||||
return m_interface.OpenEntry (this, entry);
|
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>
|
/// <summary>
|
||||||
/// Create file corresponding to <paramref name="entry"/> within current directory and open
|
/// Create file corresponding to <paramref name="entry"/> within current directory and open
|
||||||
/// it for writing.
|
/// it for writing.
|
||||||
|
|||||||
Reference in New Issue
Block a user