I want to convert my result array in ArrayList format to ByteBuffer form.
public ByteBuffer createDNSClientQuestion() {
ArrayList<Byte> result = new ArrayList<Byte>(QNAME);
result.add((byte) 0);
result.add((byte) QTYPE);
result.add((byte) 0);
result.add((byte) 1);
//here, I want to convert result ArrayList to ByteBuffer form and return it.
}
Any help will be appreciated! Thanks!