DnsMessage message = new DnsMessage();
message.decode(origBuffer);
origBuffer = new ByteArrayBuffer(raw);
Buffer buffer = new ByteArrayBuffer(512);
message.encode(buffer);
byte[] encoded = buffer.asArray();
//System.out.println(message);
DnsMessage message2 = new DnsMessage();
message2.decode(new ByteArrayBuffer(encoded));