mirror of
https://github.com/SabreTools/SabreTools.Serialization.git
synced 2026-07-08 18:06:41 +00:00
Add XZ parsing to wrapper
This commit is contained in:
@@ -73,7 +73,21 @@ namespace SabreTools.Serialization.Wrappers
|
||||
if (data == null || !data.CanRead)
|
||||
return null;
|
||||
|
||||
return new XZ(new Archive(), data);
|
||||
try
|
||||
{
|
||||
// Cache the current offset
|
||||
long currentOffset = data.Position;
|
||||
|
||||
var model = new Readers.XZ().Deserialize(data);
|
||||
if (model == null)
|
||||
return null;
|
||||
|
||||
return new XZ(model, data, currentOffset);
|
||||
}
|
||||
catch
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user