|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object jodd.io.StreamUtil
public class StreamUtil
Optimized byte and character stream utilities.
Field Summary | |
---|---|
static int |
BUFFER_SIZE
Buffer size is set to 32 KB. |
Constructor Summary | |
---|---|
StreamUtil()
|
Method Summary | |
---|---|
static void |
close(java.io.InputStream in)
Closes an input stream and releases any system resources associated with this stream. |
static void |
close(java.io.OutputStream out)
Closes an output stream and releases any system resources associated with this stream. |
static void |
close(java.io.Reader in)
Closes a character-input stream and releases any system resources associated with this stream. |
static void |
close(java.io.Writer out)
Closes a character-output stream and releases any system resources associated with this stream. |
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int BUFFER_SIZE
Constructor Detail |
---|
public StreamUtil()
Method Detail |
---|
public static void close(java.io.InputStream in)
public static void close(java.io.OutputStream out)
public static void close(java.io.Reader in)
public static void close(java.io.Writer out)
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.availiable()
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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |