Example #1
0
 public void TestReadShortLength()
 {
     MemoryStream m = new MemoryStream();
     m.WriteByte(0x66);
     m.Flush();
     m.Position = 0;
     Assert.AreEqual(new Tuple<int, byte[]>(102, new byte[] {0x66}), m.ReadPayloadLength());
 }
 public void TestReadLongLength()
 {
     byte[] expected = new byte[] {0x83, 0x73, 0x59, 0xB5};
     MemoryStream m = new MemoryStream();
     m.Write(expected, 0, 4);
     m.Flush();
     m.Position = 0;
     Assert.AreEqual(7559605, m.ReadPayloadLength().Item1);
 }
 public void TestReadShortLength()
 {
     MemoryStream m = new MemoryStream();
     m.WriteByte(0x66);
     m.Flush();
     m.Position = 0;
     var result = m.ReadPayloadLength();
     Assert.AreEqual(102, result.Item1);
     Assert.AreEqual(new byte[] {0x66}, result.Item2);
 }