Skip to content

Commit 886ebfc

Browse files
committed
Javadoc
1 parent 896a441 commit 886ebfc

32 files changed

+415
-419
lines changed

src/main/java/org/apache/commons/io/IOUtils.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,7 @@ public static BufferedInputStream buffer(final InputStream inputStream, final in
274274
*
275275
* @param outputStream the OutputStream to wrap or return (not null).
276276
* @return the given OutputStream or a new {@link BufferedOutputStream} for the given OutputStream
277-
* @throws NullPointerException if the input parameter is null..
277+
* @throws NullPointerException if the input parameter is null.
278278
* @since 2.5
279279
*/
280280
@SuppressWarnings("resource") // parameter null check
@@ -396,7 +396,7 @@ private static char[] charArray() {
396396
/**
397397
* Returns a new char array of the given size.
398398
*
399-
* TODO Consider guarding or warning against large allocations...
399+
* TODO Consider guarding or warning against large allocations.
400400
*
401401
* @param size array size.
402402
* @return a new char array of the given size.

src/main/java/org/apache/commons/io/input/RandomAccessFileInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ public void close() throws IOException {
199199
* @param pos Where to start copying. The offset position, measured in bytes from the beginning of the file, at which to set the file pointer.
200200
* @param size The number of bytes to copy.
201201
* @param os Where to copy.
202-
* @return The number of bytes copied..
202+
* @return The number of bytes copied.
203203
* @throws IOException if {@code pos} is less than {@code 0} or if an I/O error occurs.
204204
* @since 2.19.0
205205
*/

src/main/java/org/apache/commons/io/input/UnixLineEndingInputStream.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public UnixLineEndingInputStream(final InputStream inputStream, final boolean en
5353

5454
/**
5555
* Closes the stream. Also closes the underlying stream.
56-
* @throws IOException upon error
56+
* @throws IOException If an I/O error occurs.
5757
*/
5858
@Override
5959
public void close() throws IOException {
@@ -113,7 +113,7 @@ public synchronized int read() throws IOException {
113113
/**
114114
* Reads the next item from the target, updating internal flags in the process
115115
* @return the next int read from the target stream
116-
* @throws IOException upon error
116+
* @throws IOException If an I/O error occurs.
117117
*/
118118
private int readWithUpdate() throws IOException {
119119
final int target = this.in.read();

src/main/java/org/apache/commons/io/input/WindowsLineEndingInputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public WindowsLineEndingInputStream(final InputStream in, final boolean lineFeed
5656
/**
5757
* Closes the stream. Also closes the underlying stream.
5858
*
59-
* @throws IOException upon error
59+
* @throws IOException If an I/O error occurs.
6060
*/
6161
@Override
6262
public void close() throws IOException {

src/main/java/org/apache/commons/io/output/AbstractByteArrayOutputStream.java

Lines changed: 37 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,9 @@ protected interface InputStreamConstructor<T extends InputStream> {
7272
/**
7373
* Constructs an InputStream subclass.
7474
*
75-
* @param buffer the buffer
76-
* @param offset the offset into the buffer
77-
* @param length the length of the buffer
75+
* @param buffer the buffer.
76+
* @param offset the offset into the buffer.
77+
* @param length the length of the buffer.
7878
* @return the InputStream subclass.
7979
*/
8080
T construct(byte[] buffer, int offset, int length);
@@ -123,7 +123,7 @@ protected T asThis() {
123123
* The methods in this class can be called after the stream has been closed without generating an {@link IOException}.
124124
*
125125
* @throws IOException never (this method should not declare this exception but it has to now due to backwards
126-
* compatibility)
126+
* compatibility).
127127
*/
128128
@Override
129129
public void close() throws IOException {
@@ -134,7 +134,7 @@ public void close() throws IOException {
134134
* Makes a new buffer available either by allocating
135135
* a new one or re-cycling an existing one.
136136
*
137-
* @param newCount the size of the buffer if one is created
137+
* @param newCount the size of the buffer if one is created.
138138
*/
139139
protected void needNewBuffer(final int newCount) {
140140
if (currentBufferIndex < buffers.size() - 1) {
@@ -190,15 +190,15 @@ protected void resetImpl() {
190190
/**
191191
* Returns the current size of the byte array.
192192
*
193-
* @return the current size of the byte array
193+
* @return the current size of the byte array.
194194
*/
195195
public abstract int size();
196196

197197
/**
198198
* Gets the current contents of this byte stream as a byte array.
199199
* The result is independent of this stream.
200200
*
201-
* @return the current contents of this output stream, as a byte array
201+
* @return the current contents of this output stream, as a byte array.
202202
* @see java.io.ByteArrayOutputStream#toByteArray()
203203
*/
204204
public abstract byte[] toByteArray();
@@ -207,7 +207,7 @@ protected void resetImpl() {
207207
* Gets the current contents of this byte stream as a byte array.
208208
* The result is independent of this stream.
209209
*
210-
* @return the current contents of this output stream, as a byte array
210+
* @return the current contents of this output stream, as a byte array.
211211
* @see java.io.ByteArrayOutputStream#toByteArray()
212212
*/
213213
protected byte[] toByteArrayImpl() {
@@ -278,10 +278,10 @@ protected <T extends InputStream> InputStream toInputStream(final InputStreamCon
278278
/**
279279
* Gets the current contents of this byte stream as a string using the virtual machine's {@link Charset#defaultCharset() default charset}.
280280
*
281-
* @return the contents of the byte array as a String
281+
* @return the contents of the byte array as a String.
282282
* @see java.io.ByteArrayOutputStream#toString()
283283
* @see Charset#defaultCharset()
284-
* @deprecated Use {@link #toString(String)} instead
284+
* @deprecated Use {@link #toString(String)} instead.
285285
*/
286286
@Override
287287
@Deprecated
@@ -294,8 +294,8 @@ public String toString() {
294294
* Gets the current contents of this byte stream as a string
295295
* using the specified encoding.
296296
*
297-
* @param charset the character encoding
298-
* @return the string converted from the byte array
297+
* @param charset the character encoding.
298+
* @return the string converted from the byte array.
299299
* @see java.io.ByteArrayOutputStream#toString(String)
300300
* @since 2.5
301301
*/
@@ -307,9 +307,9 @@ public String toString(final Charset charset) {
307307
* Gets the current contents of this byte stream as a string
308308
* using the specified encoding.
309309
*
310-
* @param enc the name of the character encoding
311-
* @return the string converted from the byte array
312-
* @throws UnsupportedEncodingException if the encoding is not supported
310+
* @param enc the name of the character encoding.
311+
* @return the string converted from the byte array.
312+
* @throws UnsupportedEncodingException if the encoding is not supported.
313313
* @see java.io.ByteArrayOutputStream#toString(String)
314314
*/
315315
public String toString(final String enc) throws UnsupportedEncodingException {
@@ -345,14 +345,12 @@ public T write(final CharSequence data, final Charset charset) {
345345
}
346346

347347
/**
348-
* Writes the entire contents of the specified input stream to this
349-
* byte stream. Bytes from the input stream are read directly into the
350-
* internal buffer of this stream.
348+
* Writes the entire contents of the specified input stream to this byte stream. Bytes from the input stream are read directly into the internal buffer of
349+
* this stream.
351350
*
352-
* @param in the input stream to read from
353-
* @return total number of bytes read from the input stream
354-
* (and written to this stream)
355-
* @throws IOException if an I/O error occurs while reading the input stream
351+
* @param in the input stream to read from.
352+
* @return total number of bytes read from the input stream (and written to this stream)
353+
* @throws IOException if an I/O error occurs while reading the input stream.
356354
* @since 1.4
357355
*/
358356
public abstract int write(InputStream in) throws IOException;
@@ -362,9 +360,10 @@ public T write(final CharSequence data, final Charset charset) {
362360

363361
/**
364362
* Writes the bytes to the byte array.
365-
* @param b the bytes to write
366-
* @param off The start offset
367-
* @param len The number of bytes to write
363+
*
364+
* @param b the bytes to write.
365+
* @param off The start offset.
366+
* @param len The number of bytes to write.
368367
*/
369368
protected void writeImpl(final byte[] b, final int off, final int len) {
370369
final int newCount = count + len;
@@ -383,14 +382,12 @@ protected void writeImpl(final byte[] b, final int off, final int len) {
383382
}
384383

385384
/**
386-
* Writes the entire contents of the specified input stream to this
387-
* byte stream. Bytes from the input stream are read directly into the
388-
* internal buffer of this stream.
385+
* Writes the entire contents of the specified input stream to this byte stream. Bytes from the input stream are read directly into the internal buffer of
386+
* this stream.
389387
*
390-
* @param in the input stream to read from
391-
* @return total number of bytes read from the input stream
392-
* (and written to this stream)
393-
* @throws IOException if an I/O error occurs while reading the input stream
388+
* @param in the input stream to read from.
389+
* @return total number of bytes read from the input stream (and written to this stream).
390+
* @throws IOException if an I/O error occurs while reading the input stream.
394391
* @since 2.7
395392
*/
396393
protected int writeImpl(final InputStream in) throws IOException {
@@ -412,7 +409,8 @@ protected int writeImpl(final InputStream in) throws IOException {
412409

413410
/**
414411
* Writes a byte to byte array.
415-
* @param b the byte to write
412+
*
413+
* @param b the byte to write.
416414
*/
417415
protected void writeImpl(final int b) {
418416
int inBufferPos = count - filledBufferSum;
@@ -425,21 +423,19 @@ protected void writeImpl(final int b) {
425423
}
426424

427425
/**
428-
* Writes the entire contents of this byte stream to the
429-
* specified output stream.
426+
* Writes the entire contents of this byte stream to the specified output stream.
430427
*
431-
* @param out the output stream to write to
432-
* @throws IOException if an I/O error occurs, such as if the stream is closed
428+
* @param out the output stream to write to.
429+
* @throws IOException if an I/O error occurs, such as if the stream is closed.
433430
* @see java.io.ByteArrayOutputStream#writeTo(OutputStream)
434431
*/
435432
public abstract void writeTo(OutputStream out) throws IOException;
436433

437434
/**
438-
* Writes the entire contents of this byte stream to the
439-
* specified output stream.
435+
* Writes the entire contents of this byte stream to the specified output stream.
440436
*
441-
* @param out the output stream to write to
442-
* @throws IOException if an I/O error occurs, such as if the stream is closed
437+
* @param out the output stream to write to.
438+
* @throws IOException if an I/O error occurs, such as if the stream is closed.
443439
* @see java.io.ByteArrayOutputStream#writeTo(OutputStream)
444440
*/
445441
protected void writeToImpl(final OutputStream out) throws IOException {

src/main/java/org/apache/commons/io/output/AppendableOutputStream.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ public T getAppendable() {
5858
* Writes a character to the underlying appendable.
5959
*
6060
* @param b the character to write
61-
* @throws IOException upon error
61+
* @throws IOException If an I/O error occurs.
6262
*/
6363
@Override
6464
public void write(final int b) throws IOException {

0 commit comments

Comments
 (0)