public void TestTableLengthWrite() { Hashtable t = new Hashtable(); t["abc"] = "def"; m_w.WriteTable(t); Check(m_w, new byte[] { 0x00, 0x00, 0x00, 0x0C, 0x03, 0x61, 0x62, 0x63, 0x53, 0x00, 0x00, 0x00, 0x03, 0x64, 0x65, 0x66 }); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteTable(_clientProperties); writer.WriteShortstr(_mechanism); writer.WriteLongstr(_response); writer.WriteShortstr(_locale); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteOctet(_versionMajor); writer.WriteOctet(_versionMinor); writer.WriteTable(_serverProperties); writer.WriteLongstr(_mechanisms); writer.WriteLongstr(_locales); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteShort(_reserved1); writer.WriteShortstr(_queue); writer.WriteShortstr(_exchange); writer.WriteShortstr(_routingKey); writer.WriteTable(_arguments); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteShort(_reserved1); writer.WriteShortstr(_destination); writer.WriteShortstr(_source); writer.WriteShortstr(_routingKey); writer.WriteBit(_nowait); writer.EndBits(); writer.WriteTable(_arguments); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteShort(_reserved1); writer.WriteShortstr(_queue); writer.WriteShortstr(_consumerTag); writer.WriteBit(_noLocal); writer.WriteBit(_noAck); writer.WriteBit(_exclusive); writer.WriteBit(_nowait); writer.EndBits(); writer.WriteTable(_arguments); }
public override void WriteArgumentsTo(ref MethodArgumentWriter writer) { writer.WriteShort(_reserved1); writer.WriteShortstr(_queue); writer.WriteBit(_passive); writer.WriteBit(_durable); writer.WriteBit(_exclusive); writer.WriteBit(_autoDelete); writer.WriteBit(_nowait); writer.EndBits(); writer.WriteTable(_arguments); }
public void TestTableLengthWrite() { var t = new Hashtable { ["abc"] = "def" }; int bytesNeeded = WireFormatting.GetTableByteCount(t); var writer = new MethodArgumentWriter(new byte[bytesNeeded]); writer.WriteTable(t); Assert.AreEqual(bytesNeeded, writer.Offset); Check(writer, new byte[] { 0x00, 0x00, 0x00, 0x0C, 0x03, 0x61, 0x62, 0x63, 0x53, 0x00, 0x00, 0x00, 0x03, 0x64, 0x65, 0x66 }); }
public void TestNestedTableWrite() { Hashtable t = new Hashtable(); Hashtable x = new Hashtable { ["y"] = 0x12345678 }; t["x"] = x; int bytesNeeded = WireFormatting.GetTableByteCount(t); var writer = new MethodArgumentWriter(new byte[bytesNeeded]); writer.WriteTable(t); Assert.AreEqual(bytesNeeded, writer.Offset); Check(writer, new byte[] { 0x00, 0x00, 0x00, 0x0E, 0x01, 0x78, 0x46, 0x00, 0x00, 0x00, 0x07, 0x01, 0x79, 0x49, 0x12, 0x34, 0x56, 0x78 }); }