private void loadData(byte[] data) throws SQLException, IOException {
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(data);
        InputStreamReader inputStreamReader = new InputStreamReader(byteArrayInputStream);
        reader = new BufferedReader(inputStreamReader);

        try {
            // Process the data
            parameterData.detectionsAdded = 0;
            parameterData.errorCount = 0;
            parameterData.rangeCheckErrorCount = 0;
            parameterData.cubeName = getCubeName();
            parameterData.outputFilename = file.getName();
            UUID parameterId = UUID.randomUUID();

            if (hasNoData(data)) {
                return;
            } else if (!hasParameterBlock(data)) {
                parameterData.parameterNumber = getParameterNumber();
                readData(parameterId);
            } else {
                readParameters();
                if (parameterData.numberDetections > 0) {
                    readData(parameterId);
                }
            }

            // Get the string for the parameters table
            dataWriterCSV.writeParameters(
                    parameterId.getMostSignificantBits(),
                    parameterId.getLeastSignificantBits(),
                    parameterData.cubeName,
                    parameterData.outputFilename,
                    parameterData.dateRun,
                    parameterData.dateLoaded,
                    parameterData.searchType,
                    parameterData.blankPixelValue,
                    parameterData.flagTrim,
                    parameterData.flagNegative,
                    parameterData.flagMW,
                    parameterData.minMW,
                    parameterData.maxMW,
                    parameterData.beamArea,
                    parameterData.beamMaj,
                    parameterData.beamMin,
                    parameterData.flagBaseline,
                    parameterData.flagSmooth,
                    parameterData.smoothType,
                    parameterData.hanningWidth,
                    parameterData.kernMaj,
                    parameterData.kernMin,
                    parameterData.kernPA,
                    parameterData.flagATrous,
                    parameterData.reconDim,
                    parameterData.scaleMin,
                    parameterData.scaleMax,
                    parameterData.snrRecon,
                    parameterData.filterCode,
                    parameterData.filterName,
                    parameterData.flagRobustStats,
                    parameterData.statSec,
                    parameterData.flagFDR,
                    parameterData.alphaFDR,
                    parameterData.FDRnumCorChan,
                    parameterData.threshold,
                    parameterData.snrCut,
                    parameterData.minPix,
                    parameterData.minChannels,
                    parameterData.minVoxels,
                    parameterData.flagGrowth,
                    parameterData.growthThreshold,
                    parameterData.growthCut,
                    parameterData.flagAdjacent,
                    parameterData.threshSpatial,
                    parameterData.threshVelocity,
                    parameterData.flagRejectBeforeMerge,
                    parameterData.flagTwoStageMerging,
                    parameterData.spectralMethod,
                    parameterData.pixelCentre,
                    parameterData.detectionThreshold,
                    parameterData.noiseLevel,
                    parameterData.noiseSpread,
                    parameterData.mean,
                    parameterData.stdDev,
                    parameterData.median,
                    parameterData.madfm,
                    parameterData.madfmStdDev,
                    parameterData.numberDetections,
                    parameterData.parameterNumber,
                    parameterData.jobName,
                    parameterData.detectionsAdded,
                    parameterData.errorCount,
                    parameterData.rangeCheckErrorCount);
        } catch (Exception e) {
            e.printStackTrace();
            logError(data, e);
        } finally {
            // Close the reader if it is still open
            if (reader != null) {
                reader.close();
            }
        }
    }