private Packet createHeaderPacket(byte type, short requestId) throws IOException {
ByteArrayPacket header = new ByteArrayPacket(new byte[]{3});
PacketData data = new PacketData(header);
data.writeByte(type);
data.writeShort(requestId);
header.flip();
return header;
}
public void setRequestListener(RequestListener requestListener) throws IOException {
this.requestListener = requestListener;