Package com.atlan.util
Class StreamUtils
java.lang.Object
com.atlan.util.StreamUtils
Utilities for working with streams of data.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringreadToEnd(InputStream stream, Charset charset) Reads the provided stream until the end and returns a string encoded with the provided charset.
-
Constructor Details
-
StreamUtils
public StreamUtils()
-
-
Method Details
-
readToEnd
Reads the provided stream until the end and returns a string encoded with the provided charset.- Parameters:
stream- the stream to readcharset- the charset to use- Returns:
- a string with the contents of the input stream
- Throws:
NullPointerException- ifstreamorcharsetisnullIOException- if an I/O error occurs
-