|
MDi JLib 1.7.4 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.io.Writer
java.io.BufferedWriter
com.microdeveloper.util.io.FileOut
public final class FileOut
Writes data out to a disk file.
Example usage of FileOut:
String[] s;
FileOut f = new FileOut( "file.txt" );
for( int i = 0 ; i < s.length ; i++ )
{
f.println( s[ i ] );
}
f.close();
| Field Summary |
|---|
| Fields inherited from class java.io.Writer |
|---|
lock |
| Constructor Summary | |
|---|---|
FileOut(String filename)
Create a new FileOut object that will start writing at the beginning of the file. |
|
FileOut(String filename,
boolean append)
Same as the other constructor only this will open the file for appending. |
|
| Method Summary | |
|---|---|
void |
print(String s)
Send a line of text to the file. |
void |
println()
Send a newline to the file. |
void |
println(String s)
Send a line of text to the file with a trailing new line appropriate for the o/s. |
void |
writeLine(String s)
Send a line of text to the file with a trailing new line appropriate for the o/s. |
| Methods inherited from class java.io.BufferedWriter |
|---|
close, flush, newLine, write, write, write |
| Methods inherited from class java.io.Writer |
|---|
append, append, append, write, write |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FileOut(String filename)
throws IOException
IOException
public FileOut(String filename,
boolean append)
throws IOException
filename - The name of the file to open. append - Pass in "true" to append.
IOException| Method Detail |
|---|
public void println(String s)
throws IOException
s - The string to send.
IOException
public void println()
throws IOException
IOException
public void writeLine(String s)
throws IOException
s - The string to send.
IOException
public void print(String s)
throws IOException
Newlines embedded in the string are properly converted. If that is not what you want, call write() instead.
s - The string to send.
IOException
|
MDi JLib 1.7.4 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||