|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.xce.io.FileOutputStream
The implementation of simple file output stream. This class privides functions to write to file.
You can open stdout(standard output stream) and stderr(standard error stream) by a constructor:
new FileOutputStream(XFile.STDOUT);
new FileOutputStream(XFile.STDERR);
And you can also open any file to write by following constructor:
new FileOutputStream("FileName");
Field Summary | |
protected XFile |
file
|
Constructor Summary | |
FileOutputStream(int fd)
A constructor to open STDOUT and STDERR. |
|
FileOutputStream(com.xce.io.String name)
A constructor to open specified file to write. |
|
FileOutputStream(com.xce.io.String name,
boolean truncate)
A constructor to open speicified file to write(or append) |
|
FileOutputStream(XFile file)
|
Method Summary | |
void |
close()
Close this file. |
void |
flush()
Flushes this file. |
void |
write(byte[] b,
int off,
int len)
Write b to the file. |
void |
write(int b)
Writes a byte. |
Field Detail |
protected XFile file
Constructor Detail |
public FileOutputStream(int fd)
fd
- must be FileOutputStream.STDOU or FilOutputStream.STDERR.IllegalArgumentException
- if fd
is not STDIN
public FileOutputStream(com.xce.io.String name) throws java.io.IOException
name
- the file name to write.java.io.IOException
- public FileOutputStream(com.xce.io.String name, boolean truncate) throws java.io.IOException
name
- the file name to write(or append)truncate
- if the value is true
and the file
is exists, it will be truncated.
Otherwise, will not be trucated.java.io.IOException
- public FileOutputStream(XFile file) throws java.io.IOException
Method Detail |
public void close() throws java.io.IOException
public void flush() throws java.io.IOException
public void write(byte[] b, int off, int len) throws java.io.IOException
b
to the file.public void write(int b) throws java.io.IOException
write(b, 0, b.length)
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |