// Path: core/src/main/java/com/github/sdnwiselab/sdnwise/util/NodeAddress.java
// public final class NodeAddress implements Comparable<NodeAddress>, Serializable {
// 
//     /**
//      * The default broadcast address.
//      */
//     public static final NodeAddress BROADCAST_ADDR = new NodeAddress("255.255");
// 
//     /**
//      * The serialVersionUID as specified in the Serializable interface.
//      */
//     private static final long serialVersionUID = 1L;
// 
//     /**
//      * A byte array containing the address. A NodeAddress is two bytes long.
//      */
//     private final byte[] addr = new byte[2];
// 
//     /**
//      * Constructor method to create a Node Address from an int.
//      *
//      * @param a int value to set a Node Address.
//      */
//     public NodeAddress(final int a) {
//         addr[0] = (byte) (a >>> Byte.SIZE);
//         addr[1] = (byte) a;
//     }
// 
//     /**
//      *
//      * Constructor method to create a Node Address from a byte array.
//      *
//      * @param a byte array value to set a Node Address.
//      */
//     public NodeAddress(final byte[] a) {
//         if (a.length == 2) {
//             addr[0] = a[0];
//             addr[1] = a[1];
//         }
//     }
// 
//     /**
//      * Constructor method to create a Node Address from a string.
//      *
//      * @param a string value to set a Node Address.
//      */
//     public NodeAddress(final String a) {
//         String[] add = a.split("\\s*\\.\\s*");
//         if (add.length == 2) {
//             addr[0] = (byte) Integer.parseInt(add[0]);
//             addr[1] = (byte) Integer.parseInt(add[1]);
//         } else {
//             int adr = Integer.parseInt(a);
//             addr[0] = (byte) (adr >>> Byte.SIZE);
//             addr[1] = (byte) adr;
//         }
//     }
// 
//     /**
//      * Constructor method to create a Node Address from two int.
//      *
//      * @param addr0 int value to set fist part of Node Address.
//      * @param addr1 int value to set second part of a Node Address.
//      */
//     public NodeAddress(final int addr0, final int addr1) {
//         addr[0] = (byte) addr0;
//         addr[1] = (byte) addr1;
//     }
// 
//     @Override
//     public int compareTo(final NodeAddress other) {
//         return Integer.valueOf(intValue()).compareTo(other.intValue());
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         return obj instanceof NodeAddress
//                 && ((NodeAddress) obj).intValue() == intValue();
//     }
// 
//     /**
//      * Gets the Node Address in Byte.
//      *
//      * @return a byte array of Node Address.
//      */
//     public byte[] getArray() {
//         return new byte[]{addr[0], addr[1]};
//     }
// 
//     /**
//      * Gets the first Byte of a NodeAddress.
//      *
//      * @return a byte value of High Part of a NodeAddress.
//      */
//     public byte getHigh() {
//         return addr[0];
//     }
// 
//     /**
//      * Gets the last Byte of a NodeAddress.
//      *
//      * @return a byte value of Low Part of a NodeAddress.
//      */
//     public byte getLow() {
//         return addr[1];
//     }
// 
//     @Override
//     public int hashCode() {
//         return Integer.valueOf(intValue()).hashCode();
//     }
// 
//     /**
//      * Returns the NodeAddress as an integer.
//      *
//      * @return int value of the NodeAddress.
//      */
//     public int intValue() {
//         return mergeBytes(addr[0], addr[1]);
//     }
// 
//     /**
//      * Checks if the address is a broadcast address.
//      *
//      * @return true if equal to 255.255 false otherwise
//      */
//     public boolean isBroadcast() {
//         return equals(BROADCAST_ADDR);
//     }
// 
//     /**
//      * Gets the Node Address in Byte.
//      *
//      * @return a byte array of Node Address.
//      */
//     public Byte[] toByteArray() {
//         return new Byte[]{addr[0], addr[1]};
//     }
// 
//     @Override
//     public String toString() {
//         return Byte.toUnsignedInt(addr[0]) + "." + Byte.toUnsignedInt(addr[1]);
//     }
// }
// 
// Path: core/src/main/java/com/github/sdnwiselab/sdnwise/util/Utils.java
// public static byte[] concatByteArray(final byte[] a, final byte[] b) {
//     return ByteBuffer.allocate(a.length + b.length).put(a).put(b).array();
// }


import static com.github.sdnwiselab.sdnwise.packet.NetworkPacket.REQUEST;
import com.github.sdnwiselab.sdnwise.util.NodeAddress;
import static com.github.sdnwiselab.sdnwise.util.Utils.concatByteArray;
            payload = new byte[remaining];
        } else {
            payload = new byte[REQUEST_PAYLOAD_SIZE];
        }

        System.arraycopy(buf, 0, payload, 0, payload.length);
        RequestPacket np = new RequestPacket(net, src, dst, id, 0, i, payload);
        ll[0] = np;

        if (i > 1) {
            payload = new byte[remaining];
            System.arraycopy(buf, REQUEST_PAYLOAD_SIZE, payload, 0, remaining);
            np = new RequestPacket(net, src, dst, id, 1, i, payload);
            ll[1] = np;
        }

        return ll;
    }

    /**
     * Merges two Request packet to obtain the original packet.
     *
     * @param rp0 the first request packet
     * @param rp1 the second request packet
     * @return the NetworkPacket contained in the two Request packets
     */
    public static NetworkPacket mergePackets(final RequestPacket rp0,
            final RequestPacket rp1) {
        if (rp0.getPart() == 0) {
            return new NetworkPacket(
// Path: core/src/main/java/com/github/sdnwiselab/sdnwise/util/NodeAddress.java
// public final class NodeAddress implements Comparable<NodeAddress>, Serializable {
// 
//     /**
//      * The default broadcast address.
//      */
//     public static final NodeAddress BROADCAST_ADDR = new NodeAddress("255.255");
// 
//     /**
//      * The serialVersionUID as specified in the Serializable interface.
//      */
//     private static final long serialVersionUID = 1L;
// 
//     /**
//      * A byte array containing the address. A NodeAddress is two bytes long.
//      */
//     private final byte[] addr = new byte[2];
// 
//     /**
//      * Constructor method to create a Node Address from an int.
//      *
//      * @param a int value to set a Node Address.
//      */
//     public NodeAddress(final int a) {
//         addr[0] = (byte) (a >>> Byte.SIZE);
//         addr[1] = (byte) a;
//     }
// 
//     /**
//      *
//      * Constructor method to create a Node Address from a byte array.
//      *
//      * @param a byte array value to set a Node Address.
//      */
//     public NodeAddress(final byte[] a) {
//         if (a.length == 2) {
//             addr[0] = a[0];
//             addr[1] = a[1];
//         }
//     }
// 
//     /**
//      * Constructor method to create a Node Address from a string.
//      *
//      * @param a string value to set a Node Address.
//      */
//     public NodeAddress(final String a) {
//         String[] add = a.split("\\s*\\.\\s*");
//         if (add.length == 2) {
//             addr[0] = (byte) Integer.parseInt(add[0]);
//             addr[1] = (byte) Integer.parseInt(add[1]);
//         } else {
//             int adr = Integer.parseInt(a);
//             addr[0] = (byte) (adr >>> Byte.SIZE);
//             addr[1] = (byte) adr;
//         }
//     }
// 
//     /**
//      * Constructor method to create a Node Address from two int.
//      *
//      * @param addr0 int value to set fist part of Node Address.
//      * @param addr1 int value to set second part of a Node Address.
//      */
//     public NodeAddress(final int addr0, final int addr1) {
//         addr[0] = (byte) addr0;
//         addr[1] = (byte) addr1;
//     }
// 
//     @Override
//     public int compareTo(final NodeAddress other) {
//         return Integer.valueOf(intValue()).compareTo(other.intValue());
//     }
// 
//     @Override
//     public boolean equals(final Object obj) {
//         return obj instanceof NodeAddress
//                 && ((NodeAddress) obj).intValue() == intValue();
//     }
// 
//     /**
//      * Gets the Node Address in Byte.
//      *
//      * @return a byte array of Node Address.
//      */
//     public byte[] getArray() {
//         return new byte[]{addr[0], addr[1]};
//     }
// 
//     /**
//      * Gets the first Byte of a NodeAddress.
//      *
//      * @return a byte value of High Part of a NodeAddress.
//      */
//     public byte getHigh() {
//         return addr[0];
//     }
// 
//     /**
//      * Gets the last Byte of a NodeAddress.
//      *
//      * @return a byte value of Low Part of a NodeAddress.
//      */
//     public byte getLow() {
//         return addr[1];
//     }
// 
//     @Override
//     public int hashCode() {
//         return Integer.valueOf(intValue()).hashCode();
//     }
// 
//     /**
//      * Returns the NodeAddress as an integer.
//      *
//      * @return int value of the NodeAddress.
//      */
//     public int intValue() {
//         return mergeBytes(addr[0], addr[1]);
//     }
// 
//     /**
//      * Checks if the address is a broadcast address.
//      *
//      * @return true if equal to 255.255 false otherwise
//      */
//     public boolean isBroadcast() {
//         return equals(BROADCAST_ADDR);
//     }
// 
//     /**
//      * Gets the Node Address in Byte.
//      *
//      * @return a byte array of Node Address.
//      */
//     public Byte[] toByteArray() {
//         return new Byte[]{addr[0], addr[1]};
//     }
// 
//     @Override
//     public String toString() {
//         return Byte.toUnsignedInt(addr[0]) + "." + Byte.toUnsignedInt(addr[1]);
//     }
// }
// 
// Path: core/src/main/java/com/github/sdnwiselab/sdnwise/util/Utils.java
// public static byte[] concatByteArray(final byte[] a, final byte[] b) {
//     return ByteBuffer.allocate(a.length + b.length).put(a).put(b).array();
// }


// Path: core/src/main/java/com/github/sdnwiselab/sdnwise/packet/RequestPacket.java
import static com.github.sdnwiselab.sdnwise.packet.NetworkPacket.REQUEST;
import com.github.sdnwiselab.sdnwise.util.NodeAddress;
import static com.github.sdnwiselab.sdnwise.util.Utils.concatByteArray;

            payload = new byte[remaining];
        } else {
            payload = new byte[REQUEST_PAYLOAD_SIZE];
        }

        System.arraycopy(buf, 0, payload, 0, payload.length);
        RequestPacket np = new RequestPacket(net, src, dst, id, 0, i, payload);
        ll[0] = np;

        if (i > 1) {
            payload = new byte[remaining];
            System.arraycopy(buf, REQUEST_PAYLOAD_SIZE, payload, 0, remaining);
            np = new RequestPacket(net, src, dst, id, 1, i, payload);
            ll[1] = np;
        }

        return ll;
    }

    /**
     * Merges two Request packet to obtain the original packet.
     *
     * @param rp0 the first request packet
     * @param rp1 the second request packet
     * @return the NetworkPacket contained in the two Request packets
     */
    public static NetworkPacket mergePackets(final RequestPacket rp0,
            final RequestPacket rp1) {
        if (rp0.getPart() == 0) {
            return new NetworkPacket(
                    concatByteArray(rp0.getData(), rp1.getData()));