public class FileWriter
extends java.io.Writer
Modifier and Type | Field and Description |
---|---|
static int |
kFileNotFound |
static int |
kFileOpenError |
java.lang.String |
sError |
protected java.io.OutputStreamWriter |
writer
The OutputStreamWriter can't be used as superclass, because the file is able to open
only with calling constructor.
|
Constructor and Description |
---|
FileWriter() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
finalize() |
void |
flush() |
boolean |
isOpen() |
int |
open(java.lang.String fileName,
boolean append)
opens a file to write.
|
void |
write(char[] cbuf,
int off,
int len) |
void |
write(java.lang.String text) |
protected java.io.OutputStreamWriter writer
public static final int kFileNotFound
public static final int kFileOpenError
public java.lang.String sError
public int open(java.lang.String fileName, boolean append)
fileName
- Path to the file. To separate folder, a slash '/' should be used.
But a backslash is also accepted.
An absolute path should be start either with slash
or with a one-char drive specifier, following by ':/'.append
- If the file exists, the content written than is appended.public boolean isOpen()
public void close()
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in class java.io.Writer
public void write(java.lang.String text) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException
public void flush() throws java.io.IOException
flush
in interface java.io.Flushable
flush
in class java.io.Writer
java.io.IOException
public void finalize()
finalize
in class java.lang.Object
public void write(char[] cbuf, int off, int len) throws java.io.IOException
write
in class java.io.Writer
java.io.IOException