|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.commons.io.CopyUtils
Utility methods for copying data.
Field Summary | |
private static int |
DEFAULT_BUFFER_SIZE
The name says it all. |
Constructor Summary | |
CopyUtils()
Instances should NOT be constructed in standard programming. |
Method Summary | |
static void |
copy(byte[] input,
java.io.OutputStream output)
Copy bytes from a byte[] to an OutputStream . |
static void |
copy(byte[] input,
java.io.Writer output)
Copy and convert bytes from a byte[] to chars on a
Writer . |
static void |
copy(byte[] input,
java.io.Writer output,
java.lang.String encoding)
Copy and convert bytes from a byte[] to chars on a
Writer , using the specified encoding. |
static int |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copy bytes from an InputStream to an OutputStream . |
static void |
copy(java.io.InputStream input,
java.io.Writer output)
Copy and convert bytes from an InputStream to chars on a
Writer . |
static void |
copy(java.io.InputStream input,
java.io.Writer output,
java.lang.String encoding)
Copy and convert bytes from an InputStream to chars on a
Writer , using the specified encoding. |
static void |
copy(java.io.Reader input,
java.io.OutputStream output)
Serialize chars from a Reader to bytes on an
OutputStream , and flush the OutputStream . |
static int |
copy(java.io.Reader input,
java.io.Writer output)
Copy chars from a Reader to a Writer . |
static void |
copy(java.lang.String input,
java.io.OutputStream output)
Serialize chars from a String to bytes on an OutputStream , and
flush the OutputStream . |
static void |
copy(java.lang.String input,
java.io.Writer output)
Copy chars from a String to a Writer . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int DEFAULT_BUFFER_SIZE
Constructor Detail |
public CopyUtils()
Method Detail |
public static void copy(byte[] input, java.io.OutputStream output) throws java.io.IOException
byte[]
to an OutputStream
.
input
- the byte array to read fromoutput
- the OutputStream
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(byte[] input, java.io.Writer output) throws java.io.IOException
byte[]
to chars on a
Writer
.
The platform's default encoding is used for the byte-to-char conversion.
input
- the byte array to read fromoutput
- the Writer
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(byte[] input, java.io.Writer output, java.lang.String encoding) throws java.io.IOException
byte[]
to chars on a
Writer
, using the specified encoding.
input
- the byte array to read fromoutput
- the Writer
to write toencoding
- The name of a supported character encoding. See the
IANA
Charset Registry for a list of valid encoding types.
java.io.IOException
- In case of an I/O problempublic static int copy(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
InputStream
to an OutputStream
.
input
- the InputStream
to read fromoutput
- the OutputStream
to write to
java.io.IOException
- In case of an I/O problempublic static int copy(java.io.Reader input, java.io.Writer output) throws java.io.IOException
Reader
to a Writer
.
input
- the Reader
to read fromoutput
- the Writer
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(java.io.InputStream input, java.io.Writer output) throws java.io.IOException
InputStream
to chars on a
Writer
.
The platform's default encoding is used for the byte-to-char conversion.
input
- the InputStream
to read fromoutput
- the Writer
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding) throws java.io.IOException
InputStream
to chars on a
Writer
, using the specified encoding.
input
- the InputStream
to read fromoutput
- the Writer
to write toencoding
- The name of a supported character encoding. See the
IANA
Charset Registry for a list of valid encoding types.
java.io.IOException
- In case of an I/O problempublic static void copy(java.io.Reader input, java.io.OutputStream output) throws java.io.IOException
Reader
to bytes on an
OutputStream
, and flush the OutputStream
.
input
- the Reader
to read fromoutput
- the OutputStream
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(java.lang.String input, java.io.OutputStream output) throws java.io.IOException
String
to bytes on an OutputStream
, and
flush the OutputStream
.
input
- the String
to read fromoutput
- the OutputStream
to write to
java.io.IOException
- In case of an I/O problempublic static void copy(java.lang.String input, java.io.Writer output) throws java.io.IOException
String
to a Writer
.
input
- the String
to read fromoutput
- the Writer
to write to
java.io.IOException
- In case of an I/O problem
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |