Beispiel #1
0
 /// <summary>
 ///   将数字转化为bytes
 /// </summary>
 public static byte[] ToBytes(this long self, bool isNetOrder = false)
 {
     return(ByteUtil.ToBytes(self, 8, isNetOrder));
 }
Beispiel #2
0
 /// <summary>
 ///   将数字转化为bytes
 /// </summary>
 public static byte[] ToBytes(this int self, bool isNetOrder = false)
 {
     return(ByteUtil.ToBytes(self & 0xFFFFFFFF, 4, isNetOrder));
 }
Beispiel #3
0
 /// <summary>
 ///   在末尾添加int类型的value
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public void AppendInt(int value)
 {
     Append(ByteUtil.ToBytes(value, 0, NetOrder()));
 }
Beispiel #4
0
 /// <summary>
 ///   在末尾添加long类型的value
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public void AppendLong(long value)
 {
     Append(ByteUtil.ToBytes(value, 0, NetOrder()));
 }
Beispiel #5
0
 /// <summary>
 ///   在末尾添加short类型的value
 /// </summary>
 /// <param name="value"></param>
 /// <returns></returns>
 public void AppendShort(short value)
 {
     Append(ByteUtil.ToBytes(value, 0, NetOrder()));
 }