public class FileHelper extends Object
| Constructor and Description |
|---|
FileHelper() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeInputStream(InputStream strm)
Convenience method to close an input stream and handle (log and throw away) any exceptions.
|
static void |
closeReader(Reader rdr)
Convenience method to close a Reader and handle (log and throw away) any exceptions.
|
static byte[] |
getBytesFromFile(File file) |
static String |
getStringFromFile(File f) |
static String |
getStringFromInputStream(InputStream is)
Note: wrap the InputStreamReader in a BufferedReader for efficiency.
|
public static String getStringFromInputStream(InputStream is)
is - public static byte[] getBytesFromFile(File file) throws IOException
IOExceptionpublic static void closeInputStream(InputStream strm)
strm - InputStream to be closedpublic static void closeReader(Reader rdr)
rdr - InputSReadertream to be closedCopyright © 2018 Hitachi Vantara. All rights reserved.