public class FileUtilities extends Object
| Constructor and Description |
|---|
FileUtilities() |
| Modifier and Type | Method and Description |
|---|---|
static BufferedInputStream |
getInputStreamFromFile(File file)
Returns an
InputStream for file. |
static BufferedOutputStream |
getOutputStreamToFile(File file)
Returns an
OutputStream for file. |
static BufferedReader |
getReaderFromFile(File file)
Returns a reader from the file file where the file may be a
regular file or gzipped.
|
static BufferedWriter |
getWriterToFile(File file)
Returns a writer to the file file where the destination file may
will be gzipped if file has the extension .gz or .gzip.
|
public static BufferedInputStream getInputStreamFromFile(File file) throws IOException
InputStream for file. Automatically wraps in
an BufferedInputStream and also in an GZIPInputStream if
the file name ends with .gz or .gzip.file - The file to read.IOException - If there is an error during reading.public static BufferedOutputStream getOutputStreamToFile(File file) throws IOException
OutputStream for file. Automatically wraps in
an BufferedOutputStream and also in an GZIPOutputStream
if the file name ends with .gz or .gzip.file - The file to write.IOException - If there is an error during stream creation.public static BufferedReader getReaderFromFile(File file) throws IOException
file - The file to read.IOException - If opening the file fails.public static BufferedWriter getWriterToFile(File file) throws IOException
file - The file to write.IOException - If opening the file fails.Copyright © 2017 JULIE Lab, Germany. All rights reserved.