mirror of
https://github.com/AssetRipper/AssetRipper.git
synced 2025-12-11 20:15:29 +01:00
17 lines
351 B
C#
17 lines
351 B
C#
namespace AssetRipper.IO.Files.Extensions
|
|
{
|
|
public static class StreamExtensions
|
|
{
|
|
public static void Align(this Stream _this) => _this.Align(4);
|
|
public static void Align(this Stream _this, int alignment)
|
|
{
|
|
long pos = _this.Position;
|
|
long mod = pos % alignment;
|
|
if (mod != 0)
|
|
{
|
|
_this.Position += alignment - mod;
|
|
}
|
|
}
|
|
}
|
|
}
|