/** * This method is a shorthand for {@link #copyChunk(RandomAccessInputStream, RandomAccessOutputStream, long, long, long, int)} * called with a {@link BufferPool#getDefaultBufferSize default buffer size}. * * @param rais the source stream * @param raos the destination stream * @param srcOffset offset to the beginning of the chunk in the source stream * @param destOffset offset to the beginning of the chunk in the destination stream * @param length number of bytes to copy * @throws java.io.IOException if an error occurred while copying data */ public static void copyChunk(RandomAccessInputStream rais, RandomAccessOutputStream raos, long srcOffset, long destOffset, long length) throws IOException { copyChunk(rais, raos, srcOffset, destOffset, length, BufferPool.getDefaultBufferSize()); }
StreamUtils.copyChunk(rais, raos, currentEntryInfo.headerOffset, 0, (currentEntryInfo.dataOffset- currentEntryInfo.headerOffset)+currentEntry.getCompressedSize()); shift = currentEntryInfo.headerOffset; StreamUtils.copyChunk(rais, raos, currentEntryInfo.headerOffset, previousEntryInfo.dataOffset+previousCompressedSize, (currentEntryInfo.dataOffset- currentEntryInfo.headerOffset)+currentEntry.getCompressedSize()); shift = currentEntryInfo.headerOffset - (previousEntryInfo.dataOffset+previousCompressedSize);