ppkarwasz commented on code in PR #776:
URL: https://github.com/apache/commons-io/pull/776#discussion_r2336381952
##########
src/main/java/org/apache/commons/io/IOUtils.java:
##########
@@ -221,6 +221,21 @@ public class IOUtils {
*/
private static final char[] SCRATCH_CHAR_BUFFER_WO = charArray();
+ /**
+ * The maximum size of an array in many Java VMs.
+ */
+ private static final int MAX_ARRAY_LENGTH = Integer.MAX_VALUE - 8;
+
+ /*
+ * Default maximum chunk size used when copying large streams into a byte
array.
+ * <p>
+ * This value is somewhat arbitrary, currently aligned with the value used
by
+ * <a
href="https://github.com/python/cpython/blob/3.14/Lib/_pyio.py">Python</a>
+ * for copying streams.
+ * </p>
+ */
+ private static final int DEFAULT_CHUNK_SIZE = 128 * 1024;
Review Comment:
I switched to 8 KiB in
https://github.com/apache/commons-io/pull/776/commits/4aba097d871332ca1ac537abb5f6880c0bf0ffc3
--
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]