org.apache.tools.ant.util
public class LazyFileOutputStream extends OutputStream
open
has been invoked
explicitly.
Since: Ant 1.6
Constructor Summary | |
---|---|
LazyFileOutputStream(String name)
Creates a stream that will eventually write to the file with
the given name and replace it. | |
LazyFileOutputStream(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. | |
LazyFileOutputStream(File f)
Creates a stream that will eventually write to the file with
the given name and replace it. | |
LazyFileOutputStream(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(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). |
Method Summary | |
---|---|
void | close()
Close the file. |
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)
Write part of a byte array. |
void | write(int b)
Write a byte. |
Parameters: name the filename.
Parameters: name the filename. append if true append rather than replace.
Parameters: f the file to create.
Parameters: file the file to create. append if true append rather than replace.
Parameters: file the file to create. append if true append rather than replace. alwaysCreate if true create the file even if nothing to write.
Throws: IOException if there is an error.
Returns silently if the file has already been opened.
Throws: IOException if there is an error.
Parameters: b the bytearray to write.
Throws: IOException if there is a problem.
Parameters: b the byte array. offset write from this index. len the number of bytes to write.
Throws: IOException if there is a probem.
Parameters: b the byte to write.
Throws: IOException if there is a problem.