Projects
openEuler:24.03:SP1:Everything
apache-commons-compress
_service:tar_scm:fix_java_8_compatibility.patch
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:tar_scm:fix_java_8_compatibility.patch of Package apache-commons-compress
--- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedSeekableByteChannelInputStream.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/BoundedSeekableByteChannelInputStream.java 2021-07-19 16:32:46.529020782 +0200 @@ -19,6 +19,7 @@ import java.io.IOException; import java.io.InputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.channels.SeekableByteChannel; @@ -83,7 +84,7 @@ } else { buf = ByteBuffer.allocate(bytesToRead); bytesRead = channel.read(buf); - buf.flip(); + ((Buffer)buf).flip(); } if (bytesRead >= 0) { buf.get(b, off, bytesRead); @@ -93,9 +94,9 @@ } private int read(final int len) throws IOException { - buffer.rewind().limit(len); + ((Buffer)buffer).rewind().limit(len); final int read = channel.read(buffer); - buffer.flip(); + ((Buffer)buffer).flip(); return read; } --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java 2021-07-19 16:20:02.675782684 +0200 @@ -26,6 +26,7 @@ import java.io.FilterInputStream; import java.io.IOException; import java.io.InputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.CharBuffer; @@ -499,7 +500,7 @@ while (pos > minPos) { pos--; channel.position(pos); - nidBuf.rewind(); + ((Buffer)nidBuf).rewind(); if (channel.read(nidBuf) < 1) { throw new EOFException(); } @@ -2016,9 +2017,9 @@ } private void readFully(final ByteBuffer buf) throws IOException { - buf.rewind(); + ((Buffer)buf).rewind(); IOUtils.readFully(channel, buf); - buf.flip(); + ((Buffer)buf).flip(); } @Override --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZOutputFile.java 2021-07-19 16:14:03.565317437 +0200 @@ -26,6 +26,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.SeekableByteChannel; @@ -341,7 +342,7 @@ crc32.reset(); crc32.update(bb.array(), SevenZFile.sevenZSignature.length + 6, 20); bb.putInt(SevenZFile.sevenZSignature.length + 2, (int) crc32.getValue()); - bb.flip(); + ((Buffer)bb).flip(); channel.write(bb); } @@ -826,7 +827,7 @@ private final ByteBuffer buffer = ByteBuffer.allocate(BUF_SIZE); @Override public void write(final int b) throws IOException { - buffer.clear(); + ((Buffer)buffer).clear(); buffer.put((byte) b).flip(); channel.write(buffer); compressedCrc32.update(b); @@ -844,7 +845,7 @@ if (len > BUF_SIZE) { channel.write(ByteBuffer.wrap(b, off, len)); } else { - buffer.clear(); + ((Buffer)buffer).clear(); buffer.put(b, off, len).flip(); channel.write(buffer); } --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/NioZipEncoding.java 2021-07-19 16:14:03.565317437 +0200 @@ -20,6 +20,7 @@ package org.apache.commons.compress.archivers.zip; import java.io.IOException; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.CharBuffer; import java.nio.charset.Charset; @@ -121,8 +122,8 @@ enc.encode(cb, out, true); // may have caused underflow, but that's been ignored traditionally - out.limit(out.position()); - out.rewind(); + ((Buffer)out).limit(out.position()); + ((Buffer)out).rewind(); return out; } --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipArchiveInputStream.java 2021-07-19 16:14:03.565317437 +0200 @@ -25,6 +25,7 @@ import java.io.InputStream; import java.io.PushbackInputStream; import java.math.BigInteger; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.util.Arrays; import java.util.zip.CRC32; @@ -256,7 +257,7 @@ allowStoredEntriesWithDataDescriptor; this.skipSplitSig = skipSplitSig; // haven't read anything so far - buf.limit(0); + ((Buffer)buf).limit(0); } public ZipArchiveEntry getNextZipEntry() throws IOException { @@ -596,13 +597,13 @@ } if (buf.position() >= buf.limit()) { - buf.position(0); + ((Buffer)buf).position(0); final int l = in.read(buf.array()); if (l == -1) { - buf.limit(0); + ((Buffer)buf).limit(0); throw new IOException("Truncated ZIP file"); } - buf.limit(l); + ((Buffer)buf).limit(l); count(l); current.bytesReadFromStream += l; @@ -795,7 +796,7 @@ } inf.reset(); - buf.clear().flip(); + ((Buffer)buf).clear().flip(); current = null; lastStoredEntry = null; } @@ -860,7 +861,7 @@ } final int length = in.read(buf.array()); if (length > 0) { - buf.limit(length); + ((Buffer)buf).limit(length); count(buf.limit()); inf.setInput(buf.array(), 0, buf.limit()); } --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipEncodingHelper.java 2021-07-19 16:29:53.519835167 +0200 @@ -18,6 +18,7 @@ package org.apache.commons.compress.archivers.zip; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; @@ -85,8 +86,8 @@ } static ByteBuffer growBufferBy(final ByteBuffer buffer, final int increment) { - buffer.limit(buffer.position()); - buffer.rewind(); + ((Buffer)buffer).limit(buffer.position()); + ((Buffer)buffer).rewind(); final ByteBuffer on = ByteBuffer.allocate(buffer.capacity() + increment); --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/archivers/zip/ZipFile.java 2021-07-19 16:28:13.175147502 +0200 @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.SequenceInputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.nio.channels.SeekableByteChannel; @@ -713,7 +714,7 @@ positionAtCentralDirectory(); centralDirectoryStartOffset = archive.position(); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); long sig = ZipLong.getValue(wordBuf); @@ -724,7 +725,7 @@ while (sig == CFH_SIG) { readCentralDirectoryEntry(noUTF8Flag); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); sig = ZipLong.getValue(wordBuf); } @@ -743,7 +744,7 @@ private void readCentralDirectoryEntry(final Map<ZipArchiveEntry, NameAndComment> noUTF8Flag) throws IOException { - cfhBbuf.rewind(); + ((Buffer)cfhBbuf).rewind(); IOUtils.readFully(archive, cfhBbuf); int off = 0; final Entry ze = new Entry(); @@ -1100,7 +1101,7 @@ archive.position() > ZIP64_EOCDL_LENGTH; if (searchedForZip64EOCD) { archive.position(archive.position() - ZIP64_EOCDL_LENGTH); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); found = Arrays.equals(ZipArchiveOutputStream.ZIP64_EOCD_LOC_SIG, wordBuf); @@ -1128,11 +1129,11 @@ private void positionAtCentralDirectory64() throws IOException { if (isSplitZipArchive) { - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); final long diskNumberOfEOCD = ZipLong.getValue(wordBuf); - dwordBbuf.rewind(); + ((Buffer)dwordBbuf).rewind(); IOUtils.readFully(archive, dwordBbuf); final long relativeOffsetOfEOCD = ZipEightByteInteger.getLongValue(dwordBuf); ((ZipSplitReadOnlySeekableByteChannel) archive) @@ -1140,12 +1141,12 @@ } else { skipBytes(ZIP64_EOCDL_LOCATOR_OFFSET - WORD /* signature has already been read */); - dwordBbuf.rewind(); + ((Buffer)dwordBbuf).rewind(); IOUtils.readFully(archive, dwordBbuf); archive.position(ZipEightByteInteger.getLongValue(dwordBuf)); } - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); if (!Arrays.equals(wordBuf, ZipArchiveOutputStream.ZIP64_EOCD_SIG)) { throw new ZipException("Archive's ZIP64 end of central " @@ -1155,13 +1156,13 @@ if (isSplitZipArchive) { skipBytes(ZIP64_EOCD_CFD_DISK_OFFSET - WORD /* signature has already been read */); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); centralDirectoryStartDiskNumber = ZipLong.getValue(wordBuf); skipBytes(ZIP64_EOCD_CFD_LOCATOR_RELATIVE_OFFSET); - dwordBbuf.rewind(); + ((Buffer)dwordBbuf).rewind(); IOUtils.readFully(archive, dwordBbuf); centralDirectoryStartRelativeOffset = ZipEightByteInteger.getLongValue(dwordBuf); ((ZipSplitReadOnlySeekableByteChannel) archive) @@ -1169,7 +1170,7 @@ } else { skipBytes(ZIP64_EOCD_CFD_LOCATOR_OFFSET - WORD /* signature has already been read */); - dwordBbuf.rewind(); + ((Buffer)dwordBbuf).rewind(); IOUtils.readFully(archive, dwordBbuf); centralDirectoryStartDiskNumber = 0; centralDirectoryStartRelativeOffset = ZipEightByteInteger.getLongValue(dwordBuf); @@ -1188,20 +1189,20 @@ throws IOException { if (isSplitZipArchive) { skipBytes(CFD_DISK_OFFSET); - shortBbuf.rewind(); + ((Buffer)shortBbuf).rewind(); IOUtils.readFully(archive, shortBbuf); centralDirectoryStartDiskNumber = ZipShort.getValue(shortBuf); skipBytes(CFD_LOCATOR_RELATIVE_OFFSET); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); centralDirectoryStartRelativeOffset = ZipLong.getValue(wordBuf); ((ZipSplitReadOnlySeekableByteChannel) archive) .position(centralDirectoryStartDiskNumber, centralDirectoryStartRelativeOffset); } else { skipBytes(CFD_LOCATOR_OFFSET); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); centralDirectoryStartDiskNumber = 0; centralDirectoryStartRelativeOffset = ZipLong.getValue(wordBuf); @@ -1238,9 +1239,9 @@ for (; off >= stopSearching; off--) { archive.position(off); try { - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); - wordBbuf.flip(); + ((Buffer)wordBbuf).flip(); } catch (final EOFException ex) { // NOSONAR break; } @@ -1352,9 +1353,9 @@ } else { archive.position(offset + LFH_OFFSET_FOR_FILENAME_LENGTH); } - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); - wordBbuf.flip(); + ((Buffer)wordBbuf).flip(); wordBbuf.get(shortBuf); final int fileNameLen = ZipShort.getValue(shortBuf); wordBbuf.get(shortBuf); @@ -1382,7 +1383,7 @@ */ private boolean startsWithLocalFileHeader() throws IOException { archive.position(0); - wordBbuf.rewind(); + ((Buffer)wordBbuf).rewind(); IOUtils.readFully(archive, wordBbuf); return Arrays.equals(wordBuf, ZipArchiveOutputStream.LFH_SIG); } @@ -1418,7 +1419,7 @@ @Override protected int read(final long pos, final ByteBuffer buf) throws IOException { final int read = archive.read(buf, pos); - buf.flip(); + ((Buffer)buf).flip(); return read; } } --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStream.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/FixedLengthBlockOutputStream.java 2021-07-19 16:16:51.850472686 +0200 @@ -21,6 +21,7 @@ import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.channels.ClosedChannelException; @@ -88,7 +89,7 @@ } private void writeBlock() throws IOException { - buffer.flip(); + ((Buffer)buffer).flip(); final int i = out.write(buffer); final boolean hasRemaining = buffer.hasRemaining(); if (i != blockSize || hasRemaining) { @@ -97,7 +98,7 @@ blockSize, i); throw new IOException(msg); } - buffer.clear(); + ((Buffer)buffer).clear(); } @Override @@ -142,7 +143,7 @@ // fill up the reset of buffer and write the block. if (buffer.position() != 0) { final int n = buffer.remaining(); - src.limit(src.position() + n); + ((Buffer)src).limit(src.position() + n); buffer.put(src); writeBlock(); srcLeft -= n; @@ -150,12 +151,12 @@ // whilst we have enough bytes in src for complete blocks, // write them directly from src without copying them to buffer while (srcLeft >= blockSize) { - src.limit(src.position() + blockSize); + ((Buffer)src).limit(src.position() + blockSize); out.write(src); srcLeft -= blockSize; } // copy any remaining bytes into buffer - src.limit(savedLimit); + ((Buffer)src).limit(savedLimit); buffer.put(src); } return srcRemaining; @@ -242,7 +243,7 @@ final int pos = buffer.position(); final int len = buffer.limit() - pos; out.write(buffer.array(), buffer.arrayOffset() + pos, len); - buffer.position(buffer.limit()); + ((Buffer)buffer).position(buffer.limit()); return len; } catch (final IOException e) { try { --- commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/IOUtils.java 2020-01-22 16:10:15.000000000 +0100 +++ commons-compress-1.21-src/src/main/java/org/apache/commons/compress/utils/IOUtils.java 2021-07-19 17:09:11.659891748 +0200 @@ -25,6 +25,7 @@ import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.nio.Buffer; import java.nio.ByteBuffer; import java.nio.channels.ReadableByteChannel; import java.nio.file.Files; @@ -372,7 +373,7 @@ break; } output.write(b.array(), 0, readNow); - b.rewind(); + ((Buffer)b).rewind(); read += readNow; } return output.toByteArray();
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2