public string ToPacketsString() { byte[] buf = new byte[this.Length]; Buffer.BlockCopy(this.memoryStream.ToArray(), 0, buf, 0, buf.Length); return(ByteUtils.BytesToHex(buf)); }
public string Dump() { return(ByteUtils.BytesToHex(this.memoryStream.ToArray(), string.Format("Packet (0x{0} - {1}): ", this.OpCode.ToString("X4"), this.Length))); }
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))); }
public void WriteHexAsBytes(string hexString) { byte[] bytes = ByteUtils.HexToBytes(hexString); WriteBytes(bytes); }