コード例 #1
0
 public string ToPacketsString()
 {
     byte[] buf = new byte[this.Length];
     Buffer.BlockCopy(this.memoryStream.ToArray(), 0, buf, 0, buf.Length);
     return(ByteUtils.BytesToHex(buf));
 }
コード例 #2
0
 public string Dump()
 {
     return(ByteUtils.BytesToHex(this.memoryStream.ToArray(), string.Format("Packet (0x{0} - {1}): ", this.OpCode.ToString("X4"), this.Length)));
 }
コード例 #3
0
 public override string ToString()
 {
     byte[] buf = new byte[this.Length - 2];
     Buffer.BlockCopy(this.memoryStream.ToArray(), 2, buf, 0, buf.Length);
     return(string.Format("Opcode: 0x{0:X4} Length: {1} Data: {2}", this.OpCode, buf.Length, ByteUtils.BytesToHex(buf)));
 }
コード例 #4
0
 public void WriteHexAsBytes(string hexString)
 {
     byte[] bytes = ByteUtils.HexToBytes(hexString);
     WriteBytes(bytes);
 }