1
0
mirror of synced 2025-02-26 06:49:45 +01:00

Fix errors

This commit is contained in:
KillzXGaming 2020-01-29 16:14:53 -05:00
parent f090f7e757
commit 3f2bcc521a

View File

@ -174,5 +174,21 @@ namespace Toolbox.Library.IO
Write(v.Z); Write(v.Z);
Write(v.W); Write(v.W);
} }
/// <summary>
/// Aligns the data by writing bytes (rather than seeking)
/// </summary>
/// <param name="alignment"></param>
/// <param name="value"></param>
public void AlignBytes(int alignment, byte value = 0x00)
{
var startPos = Position;
long position = Seek((-Position % alignment + alignment) % alignment, SeekOrigin.Current);
Seek(startPos, System.IO.SeekOrigin.Begin);
while (Position != position) {
Write(value);
}
}
} }
} }