|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.any23.util.StreamUtils
public class StreamUtils
Contains general utility functions for handling streams.
| Method Summary | |
|---|---|
static String[] |
asLines(InputStream is)
Returns all the lines read from an input stream. |
static String |
asString(InputStream is)
Returns the string content of a stream, new line chars will be removed. |
static String |
asString(InputStream is,
boolean preserveNL)
Returns the string content of a stream. |
static void |
closeGracefully(Closeable closable)
Closes the closable interface and reports error if any. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static String[] asLines(InputStream is)
throws IOException
is - input stream.
null lines.
IOException
public static String asString(InputStream is,
boolean preserveNL)
throws IOException
is - input stream.preserveNL - preserves new line chars.
IOException - if an error occurs while consuming the is stream.
public static String asString(InputStream is)
throws IOException
is - input stream.
IOException - if an error occurs while consuming the is stream.public static void closeGracefully(Closeable closable)
closable - the closable object to be closed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||