Пример #1
0
        public string DumpRemaining()
        {
            byte[] buf = new byte[this.Length - this.memoryStream.Position];
            Buffer.BlockCopy(this.memoryStream.ToArray(), (int)this.memoryStream.Position, buf, 0, buf.Length);

            return(ByteUtils.BytesToHex(buf, string.Format("Packet (0x{0} - {1}): ", this.OpCode.ToString("X4"), this.Length)));
        }
Пример #2
0
 public string ToPacketsString()
 {
     byte[] buf = new byte[this.Length];
     Buffer.BlockCopy(this.memoryStream.ToArray(), 0, buf, 0, buf.Length);
     return(ByteUtils.BytesToHex(buf));
 }
Пример #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 string Dump()
 {
     return(ByteUtils.BytesToHex(this.memoryStream.ToArray(), string.Format("Packet (0x{0} - {1}): ", this.OpCode.ToString("X4"), this.Length)));
 }