Class IOUtils
java.lang.Object
de.iip_ecosphere.platform.support.IOUtils
I/O utilities.
- Author:
- Holger Eichelberger, SSE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreadLines(InputStream in) Gets the contents of anInputStreamas a list of Strings, one entry per line, using the Java platform default character encoding.readLines(InputStream in, Charset charset) Gets the contents of anInputStreamas a list of Strings, one entry per line, using the specified character encoding.static byte[]toByteArray(InputStream inputStream) Gets the contents of anInputStreamas abyte[].static StringtoString(InputStream in) Gets the contents of anInputStreamas a String using the specified Java platform default character encoding.static StringtoString(InputStream in, Charset charset) Gets the contents of anInputStreamas a String using the specified character encoding.
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
readLines
Gets the contents of anInputStreamas a list of Strings, one entry per line, using the Java platform default character encoding.- Parameters:
in- theInputStreamto read- Returns:
- the list of Strings
- Throws:
IOException- if an I/O error occurs
-
readLines
Gets the contents of anInputStreamas a list of Strings, one entry per line, using the specified character encoding.- Parameters:
in- theInputStreamto readcharset- the charset to use, null means platform default- Returns:
- the list of Strings
- Throws:
IOException- if an I/O error occurs
-
toString
Gets the contents of anInputStreamas a String using the specified Java platform default character encoding.- Parameters:
in- theInputStreamto read- Returns:
- the requested String
- Throws:
IOException- if an I/O error occurs
-
toString
Gets the contents of anInputStreamas a String using the specified character encoding.- Parameters:
in- theInputStreamto readcharset- the charset to use, null means platform default- Returns:
- the requested String
- Throws:
IOException- if an I/O error occurs
-
toByteArray
Gets the contents of anInputStreamas abyte[].- Parameters:
inputStream- theInputStreamto read.- Returns:
- the requested byte array.
- Throws:
NullPointerException- if the InputStream isnull.IOException- if an I/O error occurs or reading more thanInteger.MAX_VALUEoccurs.
-