Package org.apache.commons.csv
Class IOUtils
java.lang.Object
org.apache.commons.csv.IOUtils
Copied from Apache Commons IO.
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int
The default buffer size (4096).private static final int
Represents the end-of-file (or stream). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static long
copy
(Reader input, Appendable output) Copies chars from a large (over 2GB)Reader
to anAppendable
.(package private) static long
copy
(Reader input, Appendable output, CharBuffer buffer) Copies chars from a large (over 2GB)Reader
to anAppendable
.(package private) static long
Copies chars from a large (over 2GB)Reader
to aWriter
.(package private) static long
Copies chars from a large (over 2GB)Reader
to aWriter
.(package private) static <T extends Throwable>
RuntimeExceptionThrows the given throwable.
-
Field Details
-
DEFAULT_BUFFER_SIZE
static final int DEFAULT_BUFFER_SIZEThe default buffer size (4096).- See Also:
-
EOF
private static final int EOFRepresents the end-of-file (or stream).- See Also:
-
-
Constructor Details
-
IOUtils
private IOUtils()No instances.
-
-
Method Details
-
copy
Copies chars from a large (over 2GB)Reader
to anAppendable
.This method buffers the input internally, so there is no need to use a
The buffer size is given byBufferedReader
.DEFAULT_BUFFER_SIZE
.- Parameters:
input
- theReader
to read fromoutput
- theAppendable
to append to- Returns:
- the number of characters copied
- Throws:
NullPointerException
- if the input or output is nullIOException
- if an I/O error occurs- Since:
- 2.7
-
copy
Copies chars from a large (over 2GB)Reader
to anAppendable
.This method uses the provided buffer, so there is no need to use a
BufferedReader
.- Parameters:
input
- theReader
to read fromoutput
- theAppendable
to write tobuffer
- the buffer to be used for the copy- Returns:
- the number of characters copied
- Throws:
NullPointerException
- if the input or output is nullIOException
- if an I/O error occurs- Since:
- 2.7
-
copyLarge
Copies chars from a large (over 2GB)Reader
to aWriter
.This method buffers the input internally, so there is no need to use a
BufferedReader
.The buffer size is given by
DEFAULT_BUFFER_SIZE
.- Parameters:
input
- theReader
to read fromoutput
- theWriter
to write to- Returns:
- the number of characters copied
- Throws:
NullPointerException
- if the input or output is nullIOException
- if an I/O error occurs- Since:
- 1.3
-
copyLarge
Copies chars from a large (over 2GB)Reader
to aWriter
.This method uses the provided buffer, so there is no need to use a
BufferedReader
.- Parameters:
input
- theReader
to read fromoutput
- theWriter
to write tobuffer
- the buffer to be used for the copy- Returns:
- the number of characters copied
- Throws:
NullPointerException
- if the input or output is nullIOException
- if an I/O error occurs- Since:
- 2.2
-
rethrow
Throws the given throwable.- Type Parameters:
T
- The throwable cast type.- Parameters:
throwable
- The throwable to rethrow.- Returns:
- nothing because we throw.
- Throws:
T
- Always thrown.
-