コード例 #1
0
 public static void WriteUInt16(byte[] buffer, int offset, ushort value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     Array.Copy(bytes, 0, buffer, offset, bytes.Length);
 }
コード例 #2
0
 public static void WriteUInt64(Stream stream, ulong value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     stream.Write(bytes, 0, bytes.Length);
 }
コード例 #3
0
 public static void WriteGuidBytes(Stream stream, Guid value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     stream.Write(bytes, 0, bytes.Length);
 }
コード例 #4
0
 public static void WriteInt16(Stream stream, short value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     stream.Write(bytes, 0, bytes.Length);
 }
コード例 #5
0
 public static void WriteUInt24(Stream stream, uint value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     stream.Write(bytes, 1, 3);
 }
コード例 #6
0
 public static uint ReadUInt32(Stream stream)
 {
     byte[] buffer = new byte[4];
     stream.Read(buffer, 0, 4);
     return(BigEndianConverter.ToUInt32(buffer, 0));
 }
コード例 #7
0
 public static void WriteUInt24(byte[] buffer, int offset, uint value)
 {
     byte[] bytes = BigEndianConverter.GetBytes(value);
     Array.Copy(bytes, 1, buffer, offset, 3);
 }
コード例 #8
0
 public static Guid ReadGuid(byte[] buffer, ref int offset)
 {
     offset += 16;
     return(BigEndianConverter.ToGuid(buffer, offset - 16));
 }
コード例 #9
0
 public static ushort ReadUInt16(Stream stream)
 {
     byte[] buffer = new byte[2];
     stream.Read(buffer, 0, 2);
     return(BigEndianConverter.ToUInt16(buffer, 0));
 }
コード例 #10
0
 public static ulong ReadUInt64(byte[] buffer, ref int offset)
 {
     offset += 8;
     return(BigEndianConverter.ToUInt64(buffer, offset - 8));
 }
コード例 #11
0
 public static uint ReadUInt32(byte[] buffer, ref int offset)
 {
     offset += 4;
     return(BigEndianConverter.ToUInt32(buffer, offset - 4));
 }
コード例 #12
0
 public static ushort ReadUInt16(byte[] buffer, ref int offset)
 {
     offset += 2;
     return(BigEndianConverter.ToUInt16(buffer, offset - 2));
 }
コード例 #13
0
 public static Guid ReadGuid(Stream stream)
 {
     byte[] buffer = new byte[16];
     stream.Read(buffer, 0, 16);
     return(BigEndianConverter.ToGuid(buffer, 0));
 }
コード例 #14
0
 public static ulong ReadUInt64(Stream stream)
 {
     byte[] buffer = new byte[8];
     stream.Read(buffer, 0, 8);
     return(BigEndianConverter.ToUInt64(buffer, 0));
 }