|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.yajul.util.Copier
public class Copier
Provides stream and reader/writer copying functions.
User: jdavis
Date: Jan 28, 2004
Time: 5:53:42 PM
Field Summary | |
---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size. |
static int |
UNLIMITED
Use this to indicate a non-length limited copy. |
Constructor Summary | |
---|---|
Copier()
|
Method Summary | |
---|---|
static int |
copy(java.io.InputStream in,
java.io.OutputStream out,
int bufsz,
int limit)
Copies the input stream into the output stream in an efficient manner. |
static int |
copy(java.io.Reader in,
java.io.Writer out,
int bufsz,
int limit)
Copies the input stream (reader) into the output stream (writer) in an efficient manner. |
static byte[] |
toByteArray(java.io.InputStream in)
Reads the entire input stream into a byte array. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int DEFAULT_BUFFER_SIZE
public static int UNLIMITED
Constructor Detail |
---|
public Copier()
Method Detail |
---|
public static int copy(java.io.InputStream in, java.io.OutputStream out, int bufsz, int limit) throws java.io.IOException
in
- The input stream.out
- The output stream. If this is null, the input will be
discarded, similar to piping to /dev/null on UN*X.bufsz
- The size of the buffer to use.limit
- The number of bytes to copy, or UNLIMITED (-1) to copy
until the end of the input stream.
java.io.IOException
- When the stream could not be copied.public static int copy(java.io.Reader in, java.io.Writer out, int bufsz, int limit) throws java.io.IOException
in
- The input readerout
- The output writer. If this is null, the input will be
discarded, similar to piping to /dev/null on UN*X.bufsz
- The size of the buffer to use.limit
- The number of bytes to copy, or UNLIMITED (-1) to copy
until the end of the input stream.
java.io.IOException
- When the stream could not be copied.public static byte[] toByteArray(java.io.InputStream in) throws java.io.IOException
in
- The input stream
java.io.IOException
- if something goes wrong while copying.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |