Пример #1
0
        public void TestCompressionLowerCase()
        {
            var compress     = new CompressionOutputContext();
            var domain       = new Domain("EXAMPLE.COM");
            var domain_bytes = compress.SerializeDomain(domain);

            compress.MoveForward((UInt16)domain_bytes.Length);

            var expected = new byte[]
            {
                7, // Length of 'example'
                101,
                120,
                97,
                109,
                112,
                108,
                101,
                3, // Length of com
                99,
                111,
                109,
                0 // Length of root
            };

            Assert.That(domain_bytes, Is.EqualTo(expected));
        }
Пример #2
0
 /**
  * Writes a single byte to the output stream.
  */
 public void WriteByte(byte value)
 {
     stream.WriteByte(value);
     compress.MoveForward(1);
 }