Package com.atlan.util
Class StreamUtils
java.lang.Object
com.atlan.util.StreamUtils
Utilities for working with streams of data.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
readToEnd
(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
- ifstream
orcharset
isnull
IOException
- if an I/O error occurs
-