public final class WriteFileUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static void |
readSourceFileAndWriteDestFile(String srcfile,
String destFile)
Writes the source file with the best performance to the destination file.
|
static void |
storeByteArrayToFile(byte[] data,
File file)
Saves a byte array to the given file.
|
static boolean |
string2File(File file,
String string2write)
The Method string2File(File, String) writes the String to the File.
|
static boolean |
string2File(File file,
String string2write,
String encoding)
The Method string2File(File, String) writes the String to the File.
|
static void |
string2File(String string2write,
String nameOfFile)
The Method string2File() writes a String to the file.
|
static void |
write2File(Reader reader,
Writer writer,
boolean closeStream)
The Method write2File() reads from an opened Reader and writes it to the opened Writer.
|
static void |
write2File(String inputFile,
String outputFile)
The Method write2File(String, String) copys a file from one filename to another.
|
static void |
write2File(String inputFile,
Writer writer,
boolean closeWriter)
The Method write2File() writes the File into the PrintWriter.
|
static void |
write2FileWithBuffer(String inputFile,
String outputFile)
The Method write2FileWithBuffer() copy the content from one file to another.
|
static void |
writeByteArrayToFile(File file,
byte[] byteArray)
Writes the given byte array to the given file.
|
static void |
writeByteArrayToFile(String filename,
byte[] byteArray)
Writes the given byte array to a file.
|
static void |
writeLinesToFile(Collection<String> collection,
File output)
Writes the input from the collection into the file.
|
static void |
writeLinesToFile(Collection<String> collection,
File output,
String encoding)
Writes the input from the collection into the file.
|
static void |
writeLinesToFile(File output,
List<String> input,
String encoding)
Writes the input from the collection into the file.
|
static void |
writeProperties2File(String filename,
Properties properties)
The Method writeProperties2File(String, Properties) writes the Properties to the file.
|
static boolean |
writeStringToFile(File file,
String string2write,
String encoding)
The Method writeStringToFile(File, String, String) writes the String to the File.
|
public static void readSourceFileAndWriteDestFile(String srcfile, String destFile)
srcfile - The source file.destFile - The destination file.public static void storeByteArrayToFile(byte[] data,
File file)
data - The byte array to be saved.file - The file to save the byte array.public static boolean string2File(File file, String string2write)
file - The File to write the String.string2write - The String to write into the File.public static boolean string2File(File file, String string2write, String encoding)
file - The File to write the String.string2write - The String to write into the File.encoding - the encodingpublic static void string2File(String string2write, String nameOfFile)
string2write - The String to write into the file.nameOfFile - The path to the file and name from the file from where we want to write the
String.public static void write2File(Reader reader, Writer writer, boolean closeStream)
reader - The opened Reader.writer - The opened Writer.closeStream - If true then close the outputStream otherwise keep open.public static void write2File(String inputFile, String outputFile)
inputFile - The Name from the File to read and copy.outputFile - The Name from the File to write into.public static void write2File(String inputFile, Writer writer, boolean closeWriter)
inputFile - The Name from the File to read and copy.writer - The PrintWriter to write into.closeWriter - If true then close the outputStream otherwise keep open.public static void write2FileWithBuffer(String inputFile, String outputFile)
inputFile - The Path to the File and name from the file from where we read.outputFile - The Path to the File and name from the file from where we want to write.public static void writeByteArrayToFile(File file, byte[] byteArray) throws IOException
file - The file.byteArray - The byte array.IOException - Signals that an I/O exception has occurred.public static void writeByteArrayToFile(String filename, byte[] byteArray) throws IOException
filename - The filename from the file.byteArray - The byte array.IOException - Signals that an I/O exception has occurred.public static void writeLinesToFile(Collection<String> collection, File output)
collection - The collection to write to file.output - The output-file.public static void writeLinesToFile(Collection<String> collection, File output, String encoding)
collection - The collection to write to file.output - The output-file.encoding - the encodingpublic static void writeLinesToFile(File output, List<String> input, String encoding)
output - The file to write the lines.input - The list with the input data.encoding - The encoding.public static void writeProperties2File(String filename, Properties properties)
filename - The filename from the file to write the properties.properties - The properties.public static boolean writeStringToFile(File file, String string2write, String encoding)
file - The File to write the String.string2write - The String to write into the File.encoding - The encoding from the file.Copyright © 2007–2015 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.