|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.cruxframework.crux.core.utils.StreamUtils
public class StreamUtils
Tool for stream manipulation
| Constructor Summary | |
|---|---|
StreamUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
read(InputStream in)
Reads an input stream and writes it to a byte array |
static String |
read(InputStream in,
String charset)
Reads an input stream and writes it to a string, using the desired charset |
static String |
readAsUTF8(InputStream in)
Reads an input stream and writes it to a string, using UTF-8 charset |
static void |
safeCloseStreams(InputStream in,
OutputStream out)
Close streams without pain |
static void |
write(InputStream in,
OutputStream out,
boolean closeBoth)
Writes the input stream to the output stream. |
static void |
write(String in,
OutputStream out,
boolean closeBoth)
Writes the input stream to the output stream. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public StreamUtils()
| Method Detail |
|---|
public static byte[] read(InputStream in)
throws IOException
responseBodyAsStream -
IOException
public static String read(InputStream in,
String charset)
throws IOException
responseBodyAsStream -
IOException
public static String readAsUTF8(InputStream in)
throws IOException
responseBodyAsStream -
IOException
public static void write(InputStream in,
OutputStream out,
boolean closeBoth)
throws IOException
responseBodyAsStream -
IOException
public static void write(String in,
OutputStream out,
boolean closeBoth)
throws IOException
responseBodyAsStream -
IOException
public static void safeCloseStreams(InputStream in,
OutputStream out)
out - in -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||