mirror of
https://github.com/TalAloni/SMBLibrary.git
synced 2025-07-03 00:03:19 +02:00
BigEndianReader / Writer: Added ReadUInt24 / WriteUInt24 methods
This commit is contained in:
parent
366c4d61d1
commit
fb7d6d4bc8
2 changed files with 36 additions and 0 deletions
|
@ -30,6 +30,18 @@ namespace Utilities
|
|||
offset += 2;
|
||||
}
|
||||
|
||||
public static void WriteUInt24(byte[] buffer, int offset, uint value)
|
||||
{
|
||||
byte[] bytes = BigEndianConverter.GetBytes(value);
|
||||
Array.Copy(bytes, 1, buffer, offset, 3);
|
||||
}
|
||||
|
||||
public static void WriteUInt24(byte[] buffer, ref int offset, uint value)
|
||||
{
|
||||
WriteUInt24(buffer, offset, value);
|
||||
offset += 3;
|
||||
}
|
||||
|
||||
public static void WriteInt32(byte[] buffer, int offset, int value)
|
||||
{
|
||||
byte[] bytes = BigEndianConverter.GetBytes(value);
|
||||
|
@ -102,6 +114,12 @@ namespace Utilities
|
|||
stream.Write(bytes, 0, bytes.Length);
|
||||
}
|
||||
|
||||
public static void WriteUInt24(Stream stream, uint value)
|
||||
{
|
||||
byte[] bytes = BigEndianConverter.GetBytes(value);
|
||||
stream.Write(bytes, 1, 3);
|
||||
}
|
||||
|
||||
public static void WriteInt32(Stream stream, int value)
|
||||
{
|
||||
byte[] bytes = BigEndianConverter.GetBytes(value);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue