1234567891011121314151617181920212223 |
- using System;
- using System.Buffers.Binary;
- namespace VeloeMinecraftLauncher.Utils.McProtocol;
- public class TUInt16
- {
- public ushort Value { set; get; }
- public TUInt16(ushort value) => Value = value;
- public byte[] GetBytes()
- {
- var v = this.Value;
- if (BitConverter.IsLittleEndian)
- {
- v = BinaryPrimitives.ReverseEndianness(v);
- }
- return BitConverter.GetBytes(v);
- }
- }
|