Skip to content

Commit

Permalink
Pass out endianess and version when using FromBinary
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchLeaders committed Jun 5, 2024
1 parent a6607e4 commit ba0c9c4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/BymlLibrary/Byml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using System.Runtime.CompilerServices;
using System.Text;
using LiteYaml.Emitter;
using BymlLibrary.Nodes.Immutable.Containers;

namespace BymlLibrary;

Expand Down Expand Up @@ -62,9 +63,16 @@ public static class YamlConfig
public BymlNodeType Type { get; set; }

public static Byml FromBinary(Span<byte> data)
{
return FromBinary(data, out _, out _);
}

public static Byml FromBinary(Span<byte> data, out Endianness endianness, out ushort version)
{
RevrsReader reader = new(data);
ImmutableByml byml = new(ref reader);
endianness = byml.Endianness;
version = byml.Header.Version;
return FromImmutable(byml, byml);
}

Expand Down

0 comments on commit ba0c9c4

Please sign in to comment.