Jeremy Pritts 6045b846f2 Refactor reading, writing, and yaml export:
* Pull up release and editor methods
* Change universal methods into extensions
* Remove Version, Platform, and Flags from AssetReader and AssetWriter
2023-03-24 22:11:02 -04:00

32 lines
712 B
C#

using AssetRipper.Assets.Collections;
using AssetRipper.IO.Endian;
namespace AssetRipper.Assets.IO.Reading
{
public sealed class AssetReader : EndianReader
{
public AssetReader(Stream stream, AssetCollection assetCollection) : base(stream, assetCollection.EndianType, false)
{
AssetCollection = assetCollection;
}
public override string ReadString()
{
int length = ReadInt32();
if (length == 0)
{
return string.Empty;
}
string ret = ReadString(length);
AlignStream();
//Strings have supposedly been aligned since 2.1.0,
//which is earlier than the beginning of AssetRipper version support.
return ret;
}
public AssetCollection AssetCollection { get; }
}
}