Skip to content

Commit eda0565

Browse files
committed
Javadoc
1 parent 5dd1dff commit eda0565

File tree

1 file changed

+32
-32
lines changed

1 file changed

+32
-32
lines changed

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

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ public static byte[] byteArray() {
370370
/**
371371
* Returns a new byte array of the given size.
372372
*
373-
* TODO Consider guarding or warning against large allocations...
373+
* TODO Consider guarding or warning against large allocations.
374374
*
375375
* @param size array size.
376376
* @return a new byte array of the given size.
@@ -1866,9 +1866,11 @@ public static LineIterator lineIterator(final Reader reader) {
18661866

18671867
/**
18681868
* Reads bytes from an input stream.
1869+
* <p>
18691870
* This implementation guarantees that it will read as many bytes
18701871
* as possible before giving up; this may not always be the case for
18711872
* subclasses of {@link InputStream}.
1873+
* </p>
18721874
*
18731875
* @param input where to read input from.
18741876
* @param buffer destination.
@@ -1882,9 +1884,11 @@ public static int read(final InputStream input, final byte[] buffer) throws IOEx
18821884

18831885
/**
18841886
* Reads bytes from an input stream.
1887+
* <p>
18851888
* This implementation guarantees that it will read as many bytes
18861889
* as possible before giving up; this may not always be the case for
18871890
* subclasses of {@link InputStream}.
1891+
* </p>
18881892
*
18891893
* @param input where to read input.
18901894
* @param buffer destination.
@@ -1960,9 +1964,11 @@ public static int read(final ReadableByteChannel input, final ByteBuffer buffer)
19601964

19611965
/**
19621966
* Reads characters from an input character stream.
1967+
* <p>
19631968
* This implementation guarantees that it will read as many characters
19641969
* as possible before giving up; this may not always be the case for
19651970
* subclasses of {@link Reader}.
1971+
* </p>
19661972
*
19671973
* @param reader where to read input from.
19681974
* @param buffer destination.
@@ -1976,9 +1982,11 @@ public static int read(final Reader reader, final char[] buffer) throws IOExcept
19761982

19771983
/**
19781984
* Reads characters from an input character stream.
1985+
* <p>
19791986
* This implementation guarantees that it will read as many characters
19801987
* as possible before giving up; this may not always be the case for
19811988
* subclasses of {@link Reader}.
1989+
* </p>
19821990
*
19831991
* @param reader where to read input from.
19841992
* @param buffer destination.
@@ -2336,18 +2344,18 @@ public static URL resourceToURL(final String name, final ClassLoader classLoader
23362344

23372345
/**
23382346
* Skips bytes from an input byte stream.
2339-
* This implementation guarantees that it will read as many bytes
2340-
* as possible before giving up; this may not always be the case for
2341-
* skip() implementations in subclasses of {@link InputStream}.
23422347
* <p>
2343-
* Note that the implementation uses {@link InputStream#read(byte[], int, int)} rather
2344-
* than delegating to {@link InputStream#skip(long)}.
2345-
* This means that the method may be considerably less efficient than using the actual skip implementation,
2346-
* this is done to guarantee that the correct number of bytes are skipped.
2348+
* This implementation guarantees that it will read as many bytes as possible before giving up; this may not always be the case for skip() implementations
2349+
* in subclasses of {@link InputStream}.
2350+
* </p>
2351+
* <p>
2352+
* Note that the implementation uses {@link InputStream#read(byte[], int, int)} rather than delegating to {@link InputStream#skip(long)}. This means that
2353+
* the method may be considerably less efficient than using the actual skip implementation, this is done to guarantee that the correct number of bytes are
2354+
* skipped.
23472355
* </p>
23482356
*
23492357
* @param input byte stream to skip.
2350-
* @param skip number of bytes to skip.
2358+
* @param skip number of bytes to skip.
23512359
* @return number of bytes actually skipped.
23522360
* @throws IOException if there is a problem reading the file.
23532361
* @throws IllegalArgumentException if toSkip is negative.
@@ -2583,22 +2591,18 @@ public static void skipFully(final Reader reader, final long toSkip) throws IOEx
25832591
}
25842592

25852593
/**
2586-
* Fetches entire contents of an {@link InputStream} and represent
2587-
* same data as result InputStream.
2594+
* Fetches entire contents of an {@link InputStream} and represent same data as result InputStream.
25882595
* <p>
25892596
* This method is useful where,
25902597
* </p>
25912598
* <ul>
25922599
* <li>Source InputStream is slow.</li>
2593-
* <li>It has network resources associated, so we cannot keep it open for
2594-
* long time.</li>
2600+
* <li>It has network resources associated, so we cannot keep it open for long time.</li>
25952601
* <li>It has network timeout associated.</li>
25962602
* </ul>
25972603
* <p>
2598-
* It can be used in favor of {@link #toByteArray(InputStream)}, since it
2599-
* avoids unnecessary allocation and copy of byte[].<br>
2600-
* This method buffers the input internally, so there is no need to use a
2601-
* {@link BufferedInputStream}.
2604+
* It can be used in favor of {@link #toByteArray(InputStream)}, since it avoids unnecessary allocation and copy of byte[].<br>
2605+
* This method buffers the input internally, so there is no need to use a {@link BufferedInputStream}.
26022606
* </p>
26032607
*
26042608
* @param input Stream to be fully buffered.
@@ -2611,26 +2615,22 @@ public static InputStream toBufferedInputStream(final InputStream input) throws
26112615
}
26122616

26132617
/**
2614-
* Fetches entire contents of an {@link InputStream} and represent
2615-
* same data as result InputStream.
2618+
* Fetches entire contents of an {@link InputStream} and represent same data as result InputStream.
26162619
* <p>
26172620
* This method is useful where,
26182621
* </p>
26192622
* <ul>
26202623
* <li>Source InputStream is slow.</li>
2621-
* <li>It has network resources associated, so we cannot keep it open for
2622-
* long time.</li>
2624+
* <li>It has network resources associated, so we cannot keep it open for long time.</li>
26232625
* <li>It has network timeout associated.</li>
26242626
* </ul>
26252627
* <p>
2626-
* It can be used in favor of {@link #toByteArray(InputStream)}, since it
2627-
* avoids unnecessary allocation and copy of byte[].<br>
2628-
* This method buffers the input internally, so there is no need to use a
2629-
* {@link BufferedInputStream}.
2628+
* It can be used in favor of {@link #toByteArray(InputStream)}, since it avoids unnecessary allocation and copy of byte[].<br>
2629+
* This method buffers the input internally, so there is no need to use a {@link BufferedInputStream}.
26302630
* </p>
26312631
*
26322632
* @param input Stream to be fully buffered.
2633-
* @param size the initial buffer size
2633+
* @param size the initial buffer size.
26342634
* @return A fully buffered stream.
26352635
* @throws IOException if an I/O error occurs.
26362636
* @since 2.5
@@ -2643,9 +2643,9 @@ public static InputStream toBufferedInputStream(final InputStream input, final i
26432643
* Returns the given reader if it is a {@link BufferedReader}, otherwise creates a BufferedReader from the given
26442644
* reader.
26452645
*
2646-
* @param reader the reader to wrap or return (not null)
2647-
* @return the given reader or a new {@link BufferedReader} for the given reader
2648-
* @throws NullPointerException if the input parameter is null
2646+
* @param reader the reader to wrap or return (not null).
2647+
* @return the given reader or a new {@link BufferedReader} for the given reader.
2648+
* @throws NullPointerException if the input parameter is null.
26492649
* @see #buffer(Reader)
26502650
* @since 2.2
26512651
*/
@@ -2657,10 +2657,10 @@ public static BufferedReader toBufferedReader(final Reader reader) {
26572657
* Returns the given reader if it is a {@link BufferedReader}, otherwise creates a BufferedReader from the given
26582658
* reader.
26592659
*
2660-
* @param reader the reader to wrap or return (not null)
2660+
* @param reader the reader to wrap or return (not null).
26612661
* @param size the buffer size, if a new BufferedReader is created.
2662-
* @return the given reader or a new {@link BufferedReader} for the given reader
2663-
* @throws NullPointerException if the input parameter is null
2662+
* @return the given reader or a new {@link BufferedReader} for the given reader.
2663+
* @throws NullPointerException if the input parameter is null.
26642664
* @see #buffer(Reader)
26652665
* @since 2.5
26662666
*/

0 commit comments

Comments
 (0)