private void parse(byte[] pakData) {
        Integer headerSize = null;
        FilePos last = null;

        Integer pakPosition = 0;
        do {
            FilePos filePos = new FilePos();
            filePos.pos = getFilePosition(pakData, pakPosition);
            pakPosition += 4;
            filePos.name = getFileName(pakData, pakPosition);
            pakPosition += filePos.name.length() + 1;
            if (headerSize == null) {
                headerSize = filePos.pos;
            }
            if (last != null) {
                last.size = filePos.pos - last.pos;
            }
            files.add(filePos);
            last = filePos;
        } while (pakPosition+4 < headerSize);

        last.size = pakData.length - last.pos;

        for (FilePos file : files) {
            file.data = Arrays.copyOfRange(pakData, file.pos, file.pos + file.size);
        }
    }