Don't hard code values in Javadoc, use {@value reference}.
MODIFY
src/main/java/org/apache/commons/io/input/ReaderInputStream.java
src/main/java/org/apache/commons/io/input/ReaderInputStream.java
@@ -144,7 +144,7 @@ public ReaderInputStream(final Reader reader, final Charset charset, final int b
/**
* Construct a new {@link ReaderInputStream} with a default input buffer size of
- * 1024 characters.
+ * {@value #DEFAULT_BUFFER_SIZE} characters.
*
* @param reader the target {@link Reader}
* @param charset the charset encoding
@@ -166,7 +166,7 @@ public ReaderInputStream(final Reader reader, final String charsetName, final in
/**
* Construct a new {@link ReaderInputStream} with a default input buffer size of
- * 1024 characters.
+ * {@value #DEFAULT_BUFFER_SIZE} characters.
*
* @param reader the target {@link Reader}
* @param charsetName the name of the charset encoding
@@ -177,7 +177,7 @@ public ReaderInputStream(final Reader reader, final String charsetName) {
/**
* Construct a new {@link ReaderInputStream} that uses the default character encoding
- * with a default input buffer size of 1024 characters.
+ * with a default input buffer size of {@value #DEFAULT_BUFFER_SIZE} characters.
*
* @param reader the target {@link Reader}
* @deprecated 2.5 use {@link #ReaderInputStream(Reader, Charset)} instead

MODIFY
src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java
src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java
* This is the base for an alternative implementation of the
* {@link java.io.ByteArrayOutputStream} class. The original implementation
* only allocates 32 bytes at the beginning. As this class is designed for
- * heavy duty it starts at 1024 bytes. In contrast to the original it doesn't
+ * heavy duty it starts at {@value #DEFAULT_SIZE} bytes. In contrast to the original it doesn't
* reallocate the whole memory block but allocates additional buffers. This
* way no buffers need to be garbage collected and the contents don't have
* to be copied to the new buffer. This class is designed to behave exactly

MODIFY
src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java
src/main/java/org/apache/commons/io/output/ByteArrayOutputStream.java
/**
* Creates a new byte array output stream. The buffer capacity is
- * initially 1024 bytes, though its size increases if necessary.
+ * initially {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes, though its size increases if necessary.
*/
public ByteArrayOutputStream() {
this(DEFAULT_SIZE);

MODIFY
src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
src/main/java/org/apache/commons/io/output/DeferredFileOutputStream.java
/**
- * Constructs an instance of this class which will trigger an event at the
- * specified threshold, and save data to a file beyond that point.
- * The initial buffer size will default to 1024 bytes which is ByteArrayOutputStream's default buffer size.
+ * Constructs an instance of this class which will trigger an event at the specified threshold, and save data to a
+ * file beyond that point. The initial buffer size will default to
+ * {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes which is ByteArrayOutputStream's default buffer size.
*
* @param threshold The number of bytes at which to trigger an event.
* @param outputFile The file to which data is saved beyond the threshold.

MODIFY
src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java
src/main/java/org/apache/commons/io/output/UnsynchronizedByteArrayOutputStream.java
public final class UnsynchronizedByteArrayOutputStream extends AbstractByteArrayOutputStream {
/**
- * Creates a new byte array output stream. The buffer capacity is
- * initially 1024 bytes, though its size increases if necessary.
+ * Creates a new byte array output stream. The buffer capacity is initially
+ * {@value AbstractByteArrayOutputStream#DEFAULT_SIZE} bytes, though its size increases if necessary.
*/
public UnsynchronizedByteArrayOutputStream() {
this(DEFAULT_SIZE);

MODIFY
src/main/java/org/apache/commons/io/output/WriterOutputStream.java
src/main/java/org/apache/commons/io/output/WriterOutputStream.java
* @since 2.0
*/
public class WriterOutputStream extends OutputStream {
- private static final int DEFAULT_BUFFER_SIZE = 1024;
+ private static final int BUFFER_SIZE = 1024;
private final Writer writer;
private final CharsetDecoder decoder;
private final CharBuffer decoderOut;
/**
- * Constructs a new {@link WriterOutputStream} with a default output buffer size of
- * 1024 characters. The output buffer will only be flushed when it overflows or when
- * {@link #flush()} or {@link #close()} is called.
+ * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE}
+ * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()}
+ * is called.
*
* @param writer the target {@link Writer}
* @param decoder the charset decoder
* @since 2.1
*/
public WriterOutputStream(final Writer writer, final CharsetDecoder decoder) {
- this(writer, decoder, DEFAULT_BUFFER_SIZE, false);
+ this(writer, decoder, BUFFER_SIZE, false);
}
/**
@@ -150,15 +150,15 @@ public WriterOutputStream(final Writer writer, final Charset charset, final int
}
/**
- * Constructs a new {@link WriterOutputStream} with a default output buffer size of
- * 1024 characters. The output buffer will only be flushed when it overflows or when
- * {@link #flush()} or {@link #close()} is called.
+ * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE}
+ * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()}
+ * is called.
*
* @param writer the target {@link Writer}
* @param charset the charset encoding
*/
public WriterOutputStream(final Writer writer, final Charset charset) {
- this(writer, charset, DEFAULT_BUFFER_SIZE, false);
+ this(writer, charset, BUFFER_SIZE, false);
}
/**
@@ -179,28 +179,28 @@ public WriterOutputStream(final Writer writer, final String charsetName, final i
}
/**
- * Constructs a new {@link WriterOutputStream} with a default output buffer size of
- * 1024 characters. The output buffer will only be flushed when it overflows or when
- * {@link #flush()} or {@link #close()} is called.
+ * Constructs a new {@link WriterOutputStream} with a default output buffer size of {@value #BUFFER_SIZE}
+ * characters. The output buffer will only be flushed when it overflows or when {@link #flush()} or {@link #close()}
+ * is called.
*
* @param writer the target {@link Writer}
* @param charsetName the name of the charset encoding
*/
public WriterOutputStream(final Writer writer, final String charsetName) {
- this(writer, charsetName, DEFAULT_BUFFER_SIZE, false);
+ this(writer, charsetName, BUFFER_SIZE, false);
}
/**
- * Constructs a new {@link WriterOutputStream} that uses the default character encoding
- * and with a default output buffer size of 1024 characters. The output buffer will only
- * be flushed when it overflows or when {@link #flush()} or {@link #close()} is called.
+ * Constructs a new {@link WriterOutputStream} that uses the default character encoding and with a default output
+ * buffer size of {@value #BUFFER_SIZE} characters. The output buffer will only be flushed when it overflows or when
+ * {@link #flush()} or {@link #close()} is called.
*
* @param writer the target {@link Writer}
* @deprecated 2.5 use {@link #WriterOutputStream(Writer, Charset)} instead
*/
@Deprecated
public WriterOutputStream(final Writer writer) {
- this(writer, Charset.defaultCharset(), DEFAULT_BUFFER_SIZE, false);
+ this(writer, Charset.defaultCharset(), BUFFER_SIZE, false);
}
/**

Don't hard code values in Javadoc, use {@value reference}.