Menu

#99 Ability to create a Message from a ByteBuffer

None
closed-accepted
nobody
None
5
2019-05-18
2016-08-10
No

Hi,

I've attached the modified DNSInput class.

Also, the following constructor must be added to Message:

/**

 * Creates a new Message from its DNS wire format representation
 * @param byteBuffer A ByteBuffer containing the DNS Message.
 */
public
Message(ByteBuffer byteBuffer) throws IOException {
    this(new DNSInput(byteBuffer));
}

The modified DNSInput class simply uses a ByteBuffer instead of using a byte array directly. All changes are backward compatible.

If the changes may be incorporated to the public sources ASAP that would be great.

Thanks,
Mickael

1 Attachments

Discussion

  • Brian Wellington

    Applied, with a few bug fixes (the DNSInput readU16() and read32() methods need to return unsigned types, not signed types).

     
  • Brian Wellington

    • status: open --> closed-accepted
    • Group: -->
     
  • Ingo

    Ingo - 2019-05-18

    Ticket moved from /p/dnsjava/patches/34/