public class StreamUtil
extends java.lang.Object
Constructor and Description |
---|
StreamUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
close(java.io.Closeable closeable)
Closes silently the closable object.
|
static boolean |
compare(java.io.InputStream input1,
java.io.InputStream input2)
Compares the content of two byte streams.
|
static boolean |
compare(java.io.Reader input1,
java.io.Reader input2)
Compares the content of two character streams.
|
static int |
copy(java.io.InputStream input,
java.io.OutputStream output)
Copies input stream to output stream using buffer.
|
static int |
copy(java.io.InputStream input,
java.io.OutputStream output,
int byteCount)
Copies specified number of bytes from input stream to output stream using buffer.
|
static void |
copy(java.io.InputStream input,
java.io.Writer output)
Copies input stream to writer using buffer.
|
static void |
copy(java.io.InputStream input,
java.io.Writer output,
int byteCount)
Copies specified number of bytes from input stream to writer using buffer.
|
static void |
copy(java.io.InputStream input,
java.io.Writer output,
java.lang.String encoding)
Copies input stream to writer using buffer and specified encoding.
|
static void |
copy(java.io.InputStream input,
java.io.Writer output,
java.lang.String encoding,
int byteCount)
Copies specified number of bytes from input stream to writer using buffer and specified encoding.
|
static void |
copy(java.io.Reader input,
java.io.OutputStream output)
Copies reader to output stream using buffer.
|
static void |
copy(java.io.Reader input,
java.io.OutputStream output,
int charCount)
Copies specified number of characters from reader to output stream using buffer.
|
static void |
copy(java.io.Reader input,
java.io.OutputStream output,
java.lang.String encoding)
Copies reader to output stream using buffer and specified encoding.
|
static void |
copy(java.io.Reader input,
java.io.OutputStream output,
java.lang.String encoding,
int charCount)
Copies specified number of characters from reader to output stream using buffer and specified encoding.
|
static int |
copy(java.io.Reader input,
java.io.Writer output)
Copies reader to writer using buffer.
|
static int |
copy(java.io.Reader input,
java.io.Writer output,
int charCount)
Copies specified number of characters from reader to writer using buffer.
|
static byte[] |
readAvailableBytes(java.io.InputStream in)
Reads all available bytes from InputStream as a byte array.
|
static byte[] |
readBytes(java.io.InputStream input) |
static byte[] |
readBytes(java.io.InputStream input,
int byteCount) |
static byte[] |
readBytes(java.io.Reader input) |
static byte[] |
readBytes(java.io.Reader input,
int byteCount) |
static byte[] |
readBytes(java.io.Reader input,
java.lang.String encoding) |
static byte[] |
readBytes(java.io.Reader input,
java.lang.String encoding,
int byteCount) |
static char[] |
readChars(java.io.InputStream input) |
static char[] |
readChars(java.io.InputStream input,
int charCount) |
static char[] |
readChars(java.io.InputStream input,
java.lang.String encoding) |
static char[] |
readChars(java.io.InputStream input,
java.lang.String encoding,
int charCount) |
static char[] |
readChars(java.io.Reader input) |
static char[] |
readChars(java.io.Reader input,
int charCount) |
public static void close(java.io.Closeable closeable)
FLushable
, it
will be flushed first. No exception will be thrown if an I/O error occurs.public static int copy(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
java.io.IOException
public static int copy(java.io.InputStream input, java.io.OutputStream output, int byteCount) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream input, java.io.Writer output) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream input, java.io.Writer output, int byteCount) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static void copy(java.io.InputStream input, java.io.Writer output, java.lang.String encoding, int byteCount) throws java.io.IOException
java.io.IOException
public static int copy(java.io.Reader input, java.io.Writer output) throws java.io.IOException
java.io.IOException
public static int copy(java.io.Reader input, java.io.Writer output, int charCount) throws java.io.IOException
java.io.IOException
public static void copy(java.io.Reader input, java.io.OutputStream output) throws java.io.IOException
java.io.IOException
public static void copy(java.io.Reader input, java.io.OutputStream output, int charCount) throws java.io.IOException
java.io.IOException
public static void copy(java.io.Reader input, java.io.OutputStream output, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static void copy(java.io.Reader input, java.io.OutputStream output, java.lang.String encoding, int charCount) throws java.io.IOException
java.io.IOException
public static byte[] readAvailableBytes(java.io.InputStream in) throws java.io.IOException
in.available()
to determine the size of input stream.
This is the fastest method for reading input stream to byte array, but
depends on stream implementation of available()
.
Buffered internally.java.io.IOException
public static byte[] readBytes(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.InputStream input, int byteCount) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.Reader input) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.Reader input, int byteCount) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.Reader input, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static byte[] readBytes(java.io.Reader input, java.lang.String encoding, int byteCount) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.InputStream input) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.InputStream input, int charCount) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.InputStream input, java.lang.String encoding) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.InputStream input, java.lang.String encoding, int charCount) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.Reader input) throws java.io.IOException
java.io.IOException
public static char[] readChars(java.io.Reader input, int charCount) throws java.io.IOException
java.io.IOException
public static boolean compare(java.io.InputStream input1, java.io.InputStream input2) throws java.io.IOException
true
if the content of the first stream is equal
to the content of the second stream.java.io.IOException
public static boolean compare(java.io.Reader input1, java.io.Reader input2) throws java.io.IOException
true
if the content of the first stream is equal
to the content of the second stream.java.io.IOException
Copyright © 2003-2013 Jodd Team