This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
commit b9e4f5e6e718ec8e4156e31bef733874700d7cbf
Author: Gary Gregory
AuthorDate: Wed Apr 12 12:33:12 2023 -0400
Bump default buffer size to IOUtils#DEFAULT_BUFFER_SIZE
- Bump default buffer size for CharSequenceInputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
- Bump default buffer size for ChunkedOutputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
- Bump default buffer size for ChunkedWriter to
IOUtils#DEFAULT_BUFFER_SIZE.
- Bump default buffer size for ReaderInputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
- Bump default buffer size for WriterOutputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
---
src/changes/changes.xml| 15
.../commons/io/input/CharSequenceInputStream.java | 11 -
.../apache/commons/io/input/ReaderInputStream.java | 28 ++
.../io/input/buffer/PeekableInputStream.java | 4 +++-
.../commons/io/output/ChunkedOutputStream.java | 4 +++-
.../apache/commons/io/output/ChunkedWriter.java| 4 +++-
.../commons/io/output/WriterOutputStream.java | 3 ++-
.../commons/io/output/ChunkedOutputStreamTest.java | 3 ++-
.../commons/io/output/ChunkedWriterTest.java | 5 +++-
9 files changed, 49 insertions(+), 28 deletions(-)
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e68f4a6a..68f1 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -544,6 +544,21 @@ The type attribute can be add,update,fix,remove.
Bump apache-rat-plugin from 0.14 to 0.15 #387.
+
+Bump default buffer size for CharSequenceInputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
+
+
+Bump default buffer size for ChunkedOutputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
+
+
+Bump default buffer size for ChunkedWriter to
IOUtils#DEFAULT_BUFFER_SIZE.
+
+
+Bump default buffer size for ReaderInputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
+
+
+Bump default buffer size for WriterOutputStream to
IOUtils#DEFAULT_BUFFER_SIZE.
+
diff --git
a/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
b/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
index 6fe6d9e8..38686f69 100644
--- a/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/CharSequenceInputStream.java
@@ -31,6 +31,7 @@ import java.nio.charset.CodingErrorAction;
import java.util.Objects;
import org.apache.commons.io.Charsets;
+import org.apache.commons.io.IOUtils;
/**
* Implements an {@link InputStream} to read from String, StringBuffer,
StringBuilder or CharBuffer.
@@ -42,8 +43,6 @@ import org.apache.commons.io.Charsets;
*/
public class CharSequenceInputStream extends InputStream {
-private static final int BUFFER_SIZE = 2048;
-
private static final int NO_MARK = -1;
private final CharsetEncoder charsetEncoder;
@@ -54,14 +53,14 @@ public class CharSequenceInputStream extends InputStream {
private int bBufMark; // position in bBuf
/**
- * Constructs a new instance with a buffer size of 2048.
+ * Constructs a new instance with a buffer size of {@link
IOUtils#DEFAULT_BUFFER_SIZE}.
*
* @param cs the input character sequence.
* @param charset the character set name to use.
* @throws IllegalArgumentException if the buffer is not large enough to
hold a complete character.
*/
public CharSequenceInputStream(final CharSequence cs, final Charset
charset) {
-this(cs, charset, BUFFER_SIZE);
+this(cs, charset, IOUtils.DEFAULT_BUFFER_SIZE);
}
/**
@@ -87,14 +86,14 @@ public class CharSequenceInputStream extends InputStream {
}
/**
- * Constructs a new instance with a buffer size of 2048.
+ * Constructs a new instance with a buffer size of {@link
IOUtils#DEFAULT_BUFFER_SIZE}.
*
* @param cs the input character sequence.
* @param charset the character set name to use.
* @throws IllegalArgumentException if the buffer is not large enough to
hold a complete character.
*/
public CharSequenceInputStream(final CharSequence cs, final String
charset) {
-this(cs, charset, BUFFER_SIZE);
+this(cs, charset, IOUtils.DEFAULT_BUFFER_SIZE);
}
/**
diff --git a/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
b/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
index 88c7d3e1..2eb92226 100644
--- a/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
+++ b/src/main/java/org/apache/commons/io/input/ReaderInputStream.java
@@ -30,6 +30,7 @@ import java.nio.charset.CodingErrorAction;
import java.util.Objects;