public void bytesReadRead(int count) { if (count > 0) { totalPackedRead += count; if (unrarCallback != null) { unrarCallback.volumeProgressChanged(totalPackedRead, totalPackedSize); } } }
void setFile(NativeStorage file) throws IOException { this.file = file; totalPackedSize = 0L; totalPackedRead = 0L; close(); rof =file.read(); try { readHeaders(); } catch (Exception e) { logger.log(Level.WARNING, "exception in archive constructor maybe file is encrypted " + "or currupt", e); // ignore exceptions to allow exraction of working files in // corrupt archive } // Calculate size of packed data for (BaseBlock block : headers) { if (block.getHeaderType() == UnrarHeadertype.FileHeader) { totalPackedSize += ((FileHeader) block).getFullPackSize(); } } if (unrarCallback != null) { unrarCallback.volumeProgressChanged(totalPackedRead, totalPackedSize); } }