private Blob[] getMySQLPackets(DatabaseAccess JavaDBAccess, Blob Packet) {
        Blob[] MySQLPackets = null;
        int MySQLPacketsID = 1;
        int pos = 1, MySQLPacketLength = 0;
        long PacketLength = 0;
        byte[] b = new byte[3];
        int extra = 0;

        try {
            PacketLength = Packet.length();
            //Sometimes there is an extraneous '\0' at the start of the packet and we need to bypass it
            /*
            if (Packet.getBytes(1, 1)[0] == 0x00) {
            extra = 1;
            }
            pos = pos + extra;
             */

            //First calculate the number of MySQL packets that are in the Packet in orther to define correctly the MySQLPackets
            pos = 1;
            MySQLPacketsID = 1;
            while (pos < PacketLength) {
                //Sometimes there is an extraneous '\0' at the start of the packet and we need to bypass it
                while ((Packet.getBytes(pos, 1)[0] == 0x00) & (pos + 1 < PacketLength)) {
                    pos++;
                }
                b = Packet.getBytes(pos, 3);
                MySQLPacketLength = byteArrayToInt(b, 1, 3);
                MySQLPacketsID++;
                pos = pos + MySQLPacketLength + 4 + extra;
//                MySQLListenerTextArea.setText(MySQLListenerTextArea.getText() + "\r\n\r\n" + MySQLPacketLength);
            }
            MySQLPackets = new Blob[MySQLPacketsID];

            //Now insert into the MySQLPackets the MySQL packets
            pos = 1;
            MySQLPacketsID = 1;
            while (pos < PacketLength) {
                //Sometimes there is an extraneous '\0' at the start of the packet and we need to bypass it
                while ((Packet.getBytes(pos, 1)[0] == 0x00) & (pos + 1 < PacketLength)) {
                    pos++;
                }
                b = Packet.getBytes(pos, 3);
                MySQLPacketLength = byteArrayToInt(b, 1, 3);
                MySQLPackets[MySQLPacketsID] = new SerialBlob(Packet.getBytes(pos, MySQLPacketLength + 4));
                MySQLPacketsID++;
                pos = pos + MySQLPacketLength + 4 + extra;
//                MySQLListenerTextArea.setText(MySQLListenerTextArea.getText() + "\r\n\r\n" + MySQLPacketLength);
            }

        } catch (Throwable e) {
            System.out.println("exception thrown:");

            if (e instanceof SQLException) {
                JavaDBAccess.printSQLError((SQLException) e);
            } else {
                e.printStackTrace();
            }
        }
        return MySQLPackets;
    }