public class IOUtils extends Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
closeQuietly(Closeable closeable)
Closes
java.io.Closeable object in safe. |
static BufferedReader |
getBufferedReader(File file,
Charset charset)
Returns BufferedReader for reading from
file. |
static BufferedReader |
getBufferedReader(File file,
String encoding)
Returns BufferedReader for reading from
file. |
static BufferedWriter |
getBufferedWriter(File file,
Charset charset)
Returns BufferedWriter for writing to
file. |
static BufferedWriter |
getBufferedWriter(File file,
String encoding)
Returns BufferedWriter for writing to
file. |
static String |
readFile(File file,
String encoding)
Reads String from file.
|
static void |
writeFile(File file,
String encoding,
CharSequence content)
Writes content to file.
|
public static void closeQuietly(Closeable closeable)
java.io.Closeable object in safe.closeable - public static String readFile(File file, String encoding) throws IOException
file - file to be readencoding - file encodingIOExceptionpublic static void writeFile(File file, String encoding, CharSequence content) throws IOException
file - the file for writing contentencoding - file encodingcontent - the content to be writed to file.IOException - if I/O error occurs.public static BufferedWriter getBufferedWriter(File file, Charset charset) throws FileNotFoundException
file.FileNotFoundExceptionpublic static BufferedWriter getBufferedWriter(File file, String encoding) throws FileNotFoundException
file.FileNotFoundExceptionpublic static BufferedReader getBufferedReader(File file, Charset charset) throws FileNotFoundException
file.FileNotFoundExceptionpublic static BufferedReader getBufferedReader(File file, String encoding) throws FileNotFoundException
file.FileNotFoundExceptionCopyright © 2016 New York University. All rights reserved.