mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
(NsaOpener.OpenEntry): use StreamRegion instead of MemoryStream.
This commit is contained in:
parent
c0afc205ee
commit
c559dbccee
@ -173,13 +173,9 @@ namespace GameRes.Formats.NScripter
|
|||||||
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
var input = arc.File.CreateStream (entry.Offset, entry.Size);
|
||||||
return UnpackEntry (input, entry as NsaEntry);
|
return UnpackEntry (input, entry as NsaEntry);
|
||||||
}
|
}
|
||||||
var data = new byte[entry.Size];
|
var encrypted = new EncryptedViewStream (arc.File, nsa_arc.Key);
|
||||||
using (var input = new EncryptedViewStream (arc.File, nsa_arc.Key))
|
var stream = new StreamRegion (encrypted, entry.Offset, entry.Size);
|
||||||
{
|
return UnpackEntry (stream, entry as NsaEntry);
|
||||||
input.Position = entry.Offset;
|
|
||||||
input.Read (data, 0, data.Length);
|
|
||||||
}
|
|
||||||
return UnpackEntry (new MemoryStream (data), entry as NsaEntry);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected Stream UnpackEntry (Stream input, NsaEntry nsa_entry)
|
protected Stream UnpackEntry (Stream input, NsaEntry nsa_entry)
|
||||||
|
Loading…
Reference in New Issue
Block a user