ppkarwasz commented on code in PR #722:
URL: https://github.com/apache/commons-compress/pull/722#discussion_r2502560244
##########
src/main/java/org/apache/commons/compress/archivers/sevenz/SevenZFile.java:
##########
@@ -2231,6 +2330,32 @@ private boolean skipEntriesWhenNeeded(final int
entryIndex, final boolean isInSa
return true;
}
+ /**
+ * {@inheritDoc}
+ *
+ * @since 1.29.0
+ */
+ @Override
+ public IOStream<? extends SevenZArchiveEntry> stream() {
+ return IOStream.of(archive.files);
+ }
+
+ /**
+ * Converts the given ByteBuffer to a byte array of the given size.
+ *
+ * @param header The buffer containing the 7z header data.
+ * @param size The size of the byte array to create.
+ * @return A byte array containing the data from the buffer.
+ * @throws IOException if there are insufficient resources to allocate the
array or insufficient data in the buffer.
+ */
+ private byte[] toByteArray(final ByteBuffer header, final int size) throws
IOException {
+ // Check if we have enough resources to allocate the array
+ MemoryLimitException.checkKiB(bytesToKiB(size * Byte.BYTES),
maxMemoryLimitKiB);
Review Comment:
`Byte.BYTES == 1`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]