Package be.personify.util.io
Class IOUtils
java.lang.Object
be.personify.util.io.IOUtils
Utility class for IO
- Author:
- vanderw
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final CharsetReturns the default charsetstatic StringgetIp()Returns the name/ipstatic StringhumanReadableByteCountBin(long bytes) static byte[]readFileAsBytes(InputStream inputStream) Read a Inputstreamstatic byte[]readFileAsBytes(Class<?> c, String fileName) Reads a file as bytesstatic String[]readFileAsLines(String fileName) static void
-
Field Details
-
CHARSET_UTF_8
- See Also:
-
LINE_SEPARATOR
-
-
Constructor Details
-
IOUtils
public IOUtils()
-
-
Method Details
-
readFileAsBytes
Read a Inputstream- Parameters:
inputStream- containign the things to read- Returns:
- a byte array cintaing the things that are read
- Throws:
IOException- containing the stacktrace
-
defaultCharset
Returns the default charset- Returns:
- the default charset
-
readFileAsBytes
Reads a file as bytes- Parameters:
c- the class for the getresourceasstreamfileName- the name of the file- Returns:
- the byte array containing the things read
- Throws:
IOException- containing the stacktrace
-
readFileAsLines
-
getIp
Returns the name/ip- Returns:
- string containing the hostname/ip of the localhost
-
zip
- Throws:
IOException
-
humanReadableByteCountBin
-