com.metaio.tools.io
Class FileWriter
java.lang.Object
com.metaio.tools.io.FileWriter
public final class FileWriter
- extends Object
Method Summary |
static void |
writeFile(InputStream is,
String path,
boolean override)
Write an input stream to the given file path. |
static boolean |
writeToFile(byte[] buffer,
int length,
String directory,
String filename)
Write a byte buffer to the file |
FileWriter
public FileWriter()
writeFile
public static void writeFile(InputStream is,
String path,
boolean override)
throws IOException
- Write an input stream to the given file path. The directories are
created if they don't exist
- Parameters:
is
- InputStream to writepath
- absolute file pathoverride
- if existing file should be replaced with new contents
- Throws:
IOException
writeToFile
public static boolean writeToFile(byte[] buffer,
int length,
String directory,
String filename)
throws IOException
- Write a byte buffer to the file
- Parameters:
buffer
- buffer to writelength
- length of the bufferdirectory
- directory where file should be writtenfilename
- filename
- Returns:
- true on success
- Throws:
IOException