@Override public void print() { super.print(); StringBuilder str = new StringBuilder(); str.append("unpSize: " + getUnpSize()); str.append("\nHostOS: " + hostOS.name()); str.append("\nMDate: " + mTime); str.append("\nFileName: " + getFileNameString()); str.append("\nunpMethod: " + Integer.toHexString(getUnpMethod())); str.append("\nunpVersion: " + Integer.toHexString(getUnpVersion())); str.append("\nfullpackedsize: " + getFullPackSize()); str.append("\nfullunpackedsize: " + getFullUnpackSize()); str.append("\nisEncrypted: " + isEncrypted()); str.append("\nisfileHeader: " + isFileHeader()); str.append("\nisSolid: " + isSolid()); str.append("\nisSplitafter: " + isSplitAfter()); str.append("\nisSplitBefore:" + isSplitBefore()); str.append("\nunpSize: " + getUnpSize()); str.append("\ndataSize: " + getDataSize()); str.append("\nisUnicode: " + isUnicode()); str.append("\nhasVolumeNumber: " + hasVolumeNumber()); str.append("\nhasArchiveDataCRC: " + hasArchiveDataCRC()); str.append("\nhasSalt: " + hasSalt()); str.append("\nhasEncryptVersions: " + hasEncryptVersion()); str.append("\nisSubBlock: " + isSubBlock()); logger.info(str.toString()); }
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; }
unpack.doUnpack(hd.getUnpVersion(), hd.isSolid());