/** * Writes bytes to ZIP entry. * * @param b the byte array to write * @param offset the start position to write from * @param length the number of bytes to write * @param method the comrpession method to use * @return the number of bytes written to the stream this time * @throws IOException on error */ long write(final byte[] b, final int offset, final int length, final int method) throws IOException { final long current = writtenToOutputStreamForLastEntry; crc.update(b, offset, length); if (method == ZipEntry.DEFLATED) { writeDeflated(b, offset, length); } else { writeCounted(b, offset, length); } sourcePayloadLength += length; return writtenToOutputStreamForLastEntry - current; }
/** * Writes bytes to ZIP entry. * * @param b the byte array to write * @param offset the start position to write from * @param length the number of bytes to write * @param method the comrpession method to use * @return the number of bytes written to the stream this time * @throws IOException on error */ long write(final byte[] b, final int offset, final int length, final int method) throws IOException { final long current = writtenToOutputStreamForLastEntry; crc.update(b, offset, length); if (method == ZipEntry.DEFLATED) { writeDeflated(b, offset, length); } else { writeCounted(b, offset, length); } sourcePayloadLength += length; return writtenToOutputStreamForLastEntry - current; }