Package org.apache.kerby.util
Class IOUtil
java.lang.Object
org.apache.kerby.util.IOUtil
Some IO and file related utilities.
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringRead a file and return the content as string assuming UTF8.static StringreadInput(InputStream in) Read an input stream and return the content as string assuming UTF8.static byte[]static voidreadInputStream(InputStream in, byte[] buf) static voidWrite a file with the content assuming UTF8.
-
Method Details
-
readInputStream
- Throws:
IOException
-
readInputStream
- Throws:
IOException
-
readInput
Read an input stream and return the content as string assuming UTF8.- Parameters:
in- The input stream- Returns:
- The read String
- Throws:
IOException- e
-
readFile
Read a file and return the content as string assuming UTF8.- Parameters:
file- The file to read- Returns:
- The content as a UTF-8 String
- Throws:
IOException- If an error occurred
-
writeFile
Write a file with the content assuming UTF8.- Parameters:
content- The contentfile- The file to write- Throws:
IOException- e
-