class ByteUtils {

    public static byte[][] split(byte[] input, int firstLength) {
        if (input.length < firstLength) {
            throw new ArrayIndexOutOfBoundsException("Specified index over input length");
        }
        byte[] first = new byte[firstLength];
        byte[] second = new byte[input.length - firstLength];

        System.arraycopy(input, 0, first, 0, firstLength);
        System.arraycopy(input, firstLength, second, 0, input.length - firstLength);
        return new byte[][]{first, second};
    }

}