|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
org.apache.tools.ant.util.LazyFileOutputStream
public class LazyFileOutputStream
Class that delays opening the output file until the first bytes
shall be written or the method open
has been invoked
explicitly.
Constructor Summary | |
---|---|
LazyFileOutputStream(java.io.File f)
Creates a stream that will eventually write to the file with the given name and replace it. |
|
LazyFileOutputStream(java.io.File file,
boolean append)
Creates a stream that will eventually write to the file with the given name and optionally append to instead of replacing it. |
|
LazyFileOutputStream(java.io.File file,
boolean append,
boolean alwaysCreate)
Creates a stream that will eventually write to the file with the given name, optionally append to instead of replacing it, and optionally always create a file (even if zero length). |
|
LazyFileOutputStream(java.lang.String name)
Creates a stream that will eventually write to the file with the given name and replace it. |
|
LazyFileOutputStream(java.lang.String name,
boolean append)
Creates a stream that will eventually write to the file with the given name and optionally append to instead of replacing it. |
Method Summary | |
---|---|
void |
close()
|
void |
open()
Explicitly open the file for writing. |
void |
write(byte[] b)
Delegates to the three-arg version. |
void |
write(byte[] b,
int offset,
int len)
|
void |
write(int b)
|
Methods inherited from class java.io.OutputStream |
---|
flush |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LazyFileOutputStream(java.lang.String name)
public LazyFileOutputStream(java.lang.String name, boolean append)
public LazyFileOutputStream(java.io.File f)
public LazyFileOutputStream(java.io.File file, boolean append)
public LazyFileOutputStream(java.io.File file, boolean append, boolean alwaysCreate)
Method Detail |
---|
public void open() throws java.io.IOException
Returns silently if the file has already been opened.
java.io.IOException
public void close() throws java.io.IOException
close
in interface java.io.Closeable
close
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(byte[] b, int offset, int len) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
public void write(int b) throws java.io.IOException
write
in class java.io.OutputStream
java.io.IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |