mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
* Pull up release and editor methods * Change universal methods into extensions * Remove Version, Platform, and Flags from AssetReader and AssetWriter
32 lines
712 B
C#
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; }
|
|
}
|
|
}
|