public static boolean mergeArchive(Archive archive, ComprDataIO dataIO) throws IOException { FileHeader hd = dataIO.getSubHeader(); if (hd.getUnpVersion()>=20 && hd.getFileCRC()!=0xffffffff && dataIO.getPackedCRC()!=~hd.getFileCRC()) { System.err.println("Data Bad CRC"); } boolean oldNumbering = !archive.getMainHeader().isNewNumbering() || archive.isOldFormat(); String nextName = nextVolumeName(archive.getFile().getPath(), oldNumbering); NativeStorage nextVolume = archive.getFile().getParent().open(nextName); UnrarCallback callback = archive.getUnrarCallback(); if ((callback != null) && !callback.isNextVolumeReady(nextVolume)) { return false; } if (!nextVolume.exists()) { return false; } archive.setFile(nextVolume); hd = archive.nextFileHeader(); if (hd == null) { return false; } dataIO.init(hd); return true; }