private void packData() {
        File tmp = new File(backupnew);
        tmp.mkdirs();
        tmp.delete();

        // Clean up potential old files
        tmp.delete();

        try {
            BufferedOutputStream out2 = new BufferedOutputStream(new FileOutputStream(tmp));

            BufferedInputStream inHead = new BufferedInputStream(new FileInputStream(fileHeader));

            // First, the 24 byte Android header
            byte header[] = new byte[24];
            Util.readBlocking(header, inHead);
            out2.write(header);

            // now enable compression on remaining output stream
            DeflaterStream out = new DeflaterStream(out2);

            // Next, the "prefix" gets written
            File f = new File(filePrefix);
            byte content[] = new byte[(int) f.length()];

            BufferedInputStream in = new BufferedInputStream(new FileInputStream(f));
            if(content.length != Util.readBlocking(content, in)) {
                out.close();
                throw new Exception("Couldn't read file + '" + filePrefix + "'");
            }
            in.close();
            out.write(content);

            // Next, the file header gets read, updated, then written
            byte fileHead[] = new byte[512];

            if(512 != Util.readBlocking(fileHead, inHead)) {
                out.close();
                throw new Exception("Couldn't read file '" + fileHeader + "'");
            }

            inHead.close();
            TarHeader thead = new TarHeader(fileHead);

            File save = new File(fileSave);
            thead.setFileSize((int) save.length());
            thead.updateChecksum();

            out.write(thead.getBytes());

            // Next, write the actual file content
            BufferedInputStream inFile = new BufferedInputStream(new FileInputStream(save));

            byte[] file = new byte[(int) save.length()];

            if(file.length != Util.readBlocking(file, inFile)) {
                out.close();
                throw new Exception("Couldn't read file '" + fileSave + "'");
            }
            inFile.close();

            out.write(file);
            if(file.length > 0 && file.length % 512 != 0) {
                out.write(new byte[512 - ((int) file.length) % 512]);
            }

            // Next, write the file postfix
            File postfix = new File(filePostfix);

            BufferedInputStream inPostfix = new BufferedInputStream(new FileInputStream(postfix));
            byte[] post = new byte[(int) postfix.length()];

            if(post.length != Util.readBlocking(post, inPostfix)) {
                out.close();
                throw new Exception("Couldn't read file '" + filePostfix + "'");
            }
            inPostfix.close();

            out.write(post);
            out.close();
        } catch(Exception e) {
            error("Something went wrong: " + e.getMessage());
            e.printStackTrace();
            return;
        }

        info("successfully generated '" + backupnew + "'");
    }