|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectkiwi.util.StreamUtils
This class consists of several convenience routines for reading and writing streams. The methods are all static.
Field Summary | |
static int |
blockSize
The data transfer block size. |
Constructor Summary | |
StreamUtils()
|
Method Summary | |
private static java.io.ByteArrayOutputStream |
readStream(java.io.InputStream input)
|
static byte[] |
readStreamToByteArray(java.io.InputStream input)
Read all of the data from a stream, returning the contents as a byte array. |
static java.io.OutputStream |
readStreamToStream(java.io.InputStream input,
java.io.OutputStream output)
Read all of the data from a stream, writing it to another stream. |
static java.lang.String |
readStreamToString(java.io.InputStream input)
Read all of the data from a stream, returning the contents as a String . |
static void |
writeStringToStream(java.lang.String s,
java.io.OutputStream output)
Write a string to a stream. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int blockSize
Constructor Detail |
public StreamUtils()
Method Detail |
public static final java.io.OutputStream readStreamToStream(java.io.InputStream input, java.io.OutputStream output) throws java.io.IOException
input
- The input stream.output
- The output stream.
java.io.IOException
- If an error occurred while reading from
the stream.public static final java.lang.String readStreamToString(java.io.InputStream input) throws java.io.IOException
String
. Note that this method is not unicode-aware.
input
- The stream to read from.
String
.
java.io.IOException
- If an error occurred while reading from
the stream.public static final void writeStringToStream(java.lang.String s, java.io.OutputStream output) throws java.io.IOException
s
- The string to write.output
- The stream to write it to.
java.io.IOException
- If an error occurred while writing to the
stream.public static final byte[] readStreamToByteArray(java.io.InputStream input) throws java.io.IOException
byte
array.
input
- The stream to read from.
byte
array.
java.io.IOException
- If an error occurred while reading from
the stream.private static final java.io.ByteArrayOutputStream readStream(java.io.InputStream input) throws java.io.IOException
java.io.IOException
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |