Examples of toWire()


Examples of org.xbill.DNS.Name.toWire()

      Compression c = new Compression();
      c.add(257, d);
      byte[] exp = new byte[] { 1, 'A', (byte)0xC1, 0x1 };

      DNSOutput o = new DNSOutput();
      n.toWire(o, c);
      assertTrue(Arrays.equals(exp, o.toByteArray()));
      assertEquals(257, c.get(d));
      assertEquals(0, c.get(n));
  }
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

  public void test_0arg_rel() throws TextParseException
  {
      Name n = new Name("A.Relative.Name");
      try {
    n.toWire();
    fail("IllegalArgumentException not thrown");
      }
      catch(IllegalArgumentException e){}
  }
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

  public void test_0arg() throws TextParseException
  {
      byte[] raw = new byte[] { 1, 'A', 5, 'B', 'a', 's', 'i', 'c', 4, 'N', 'a', 'm', 'e', 0 };
      Name n = new Name("A.Basic.Name.");
     
      byte[] out = n.toWire();

      assertTrue(Arrays.equals(raw, out));
  }

  public void test_root()
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

      Compression c = new Compression();
      c.add(257, d);
      byte[] exp = new byte[] { 1, 'A', (byte)0xC1, 0x1 };

      DNSOutput o = new DNSOutput();
      n.toWire(o, c, false);
      assertTrue(Arrays.equals(exp, o.toByteArray()));
      assertEquals(257, c.get(d));
      assertEquals(0, c.get(n));
  }
    }
View Full Code Here

Examples of org.xbill.DNS.Name.toWire()

      Compression c = new Compression();
      c.add(257, d);
      byte[] exp = new byte[] { 1, 'a', 5, 'b', 'a', 's', 'i', 'c', 4, 'n', 'a', 'm', 'e', 0 };

      DNSOutput o = new DNSOutput();
      n.toWire(o, c, true);
      assertTrue(Arrays.equals(exp, o.toByteArray()));
      assertEquals(257, c.get(d));
      assertEquals(-1, c.get(n));
  }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.