|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.util.stream.Streams
public final class Streams
A collection of stream related utility methods.
Exceptions that are thrown and not explicitly declared are given to
the ThrowableHandler for further processing.
| Field Summary | |
|---|---|
static int |
DEFAULT_BUFFER_SIZE
The default buffer size that will be used for buffered operations. |
| Constructor Summary | |
|---|---|
Streams()
|
|
| Method Summary | |
|---|---|
static boolean |
close(InputStream stream)
Attempt to close an InputStream. |
static boolean |
close(InputStream[] streams)
Attempt to close an array of InputStreams. |
static boolean |
close(Object stream)
Attempt to close an InputStream or OutputStream. |
static boolean |
close(Object[] streams)
Attempt to close an array of InputStreama and/or OutputStreams. |
static boolean |
close(OutputStream stream)
Attempt to close an OutputStream. |
static boolean |
close(OutputStream[] streams)
Attempt to close an array of OutputStreams. |
static long |
copy(InputStream input,
OutputStream output)
Copy all of the bytes from the input stream to the output stream. |
static long |
copy(InputStream input,
OutputStream output,
byte[] buffer)
Copy all of the bytes from the input stream to the output stream. |
static long |
copy(InputStream input,
OutputStream output,
int size)
Copy all of the bytes from the input stream to the output stream. |
static long |
copyb(InputStream input,
OutputStream output)
Copy all of the bytes from the input stream to the output stream wrapping streams in buffers as needed. |
static long |
copySome(InputStream input,
OutputStream output,
byte[] buffer,
long length)
Copy a limited number of bytes from the input stream to the output stream. |
static long |
copySome(InputStream input,
OutputStream output,
int size,
long length)
Copy a limited number of bytes from the input stream to the output stream. |
static long |
copySome(InputStream input,
OutputStream output,
long length)
Copy a limited number of bytes from the input stream to the output stream. |
static boolean |
fclose(OutputStream stream)
Attempt to flush and close an OutputStream. |
static boolean |
fclose(OutputStream[] streams)
Attempt to flush and close an array of OutputStreams. |
static boolean |
flush(OutputStream stream)
Attempt to flush an OutputStream. |
static boolean |
flush(OutputStream[] streams)
Attempt to flush an array of OutputStreams. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int DEFAULT_BUFFER_SIZE
| Constructor Detail |
|---|
public Streams()
| Method Detail |
|---|
public static boolean close(InputStream stream)
stream - InputStream to attempt to close.
public static boolean close(OutputStream stream)
stream - OutputStream to attempt to close.
public static boolean close(Object stream)
stream - Stream to attempt to close.
IllegalArgumentException - Stream is not an InputStream
or OuputStream.public static boolean close(InputStream[] streams)
streams - Array of InputStreams to attempt to close.
public static boolean close(OutputStream[] streams)
streams - Array of OutputStreams to attempt to close.
public static boolean close(Object[] streams)
streams - Array of streams to attempt to close.
IllegalArgumentException - Stream is not an InputStream
or OuputStream. Closing
stops at the last valid stream
object in this case.public static boolean fclose(OutputStream stream)
stream - OutputStream to attempt to flush and close.
public static boolean fclose(OutputStream[] streams)
streams - OutputStreams to attempt to flush and close.
public static boolean flush(OutputStream stream)
stream - OutputStream to attempt to flush.
public static boolean flush(OutputStream[] streams)
streams - OutputStreams to attempt to flush.
public static long copy(InputStream input,
OutputStream output,
byte[] buffer)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.buffer - The buffer to use while copying.
IOException - Failed to copy bytes.
public static long copy(InputStream input,
OutputStream output,
int size)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.size - The size of the buffer to use while copying.
IOException - Failed to copy bytes.
public static long copy(InputStream input,
OutputStream output)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.
IOException - Failed to copy bytes.
public static long copyb(InputStream input,
OutputStream output)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.
IOException - Failed to copy bytes.
public static long copySome(InputStream input,
OutputStream output,
byte[] buffer,
long length)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.buffer - The buffer to use while copying.length - The maximum number of bytes to copy.
IOException - Failed to copy bytes.
public static long copySome(InputStream input,
OutputStream output,
int size,
long length)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.size - The size of the buffer to use while copying.length - The maximum number of bytes to copy.
IOException - Failed to copy bytes.
public static long copySome(InputStream input,
OutputStream output,
long length)
throws IOException
input - Stream to read bytes from.output - Stream to write bytes to.length - The maximum number of bytes to copy.
IOException - Failed to copy bytes.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||