| java.lang.Object java.io.OutputStream org.apache.tools.ant.util.LazyFileOutputStream
LazyFileOutputStream | public class LazyFileOutputStream extends OutputStream (Code) | | Class that delays opening the output file until the first bytes
shall be written or the method
LazyFileOutputStream.open open has been invoked
explicitly.
since: Ant 1.6 |
Constructor Summary | |
public | LazyFileOutputStream(String name) Creates a stream that will eventually write to the file with
the given name and replace it. | public | 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. | public | LazyFileOutputStream(File f) Creates a stream that will eventually write to the file with
the given name and replace it. | public | 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. | public | 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 | |
public synchronized void | close() Close the file. | public void | open() Explicitly open the file for writing. | public void | write(byte[] b) Delegates to the three-arg version. | public synchronized void | write(byte[] b, int offset, int len) Write part of a byte array. | public synchronized void | write(int b) Write a byte. |
LazyFileOutputStream | public LazyFileOutputStream(String name)(Code) | | Creates a stream that will eventually write to the file with
the given name and replace it.
Parameters: name - the filename. |
LazyFileOutputStream | public LazyFileOutputStream(String name, boolean append)(Code) | | Creates a stream that will eventually write to the file with
the given name and optionally append to instead of replacing
it.
Parameters: name - the filename. Parameters: append - if true append rather than replace. |
LazyFileOutputStream | public LazyFileOutputStream(File f)(Code) | | Creates a stream that will eventually write to the file with
the given name and replace it.
Parameters: f - the file to create. |
LazyFileOutputStream | public LazyFileOutputStream(File file, boolean append)(Code) | | Creates a stream that will eventually write to the file with
the given name and optionally append to instead of replacing
it.
Parameters: file - the file to create. Parameters: append - if true append rather than replace. |
LazyFileOutputStream | public LazyFileOutputStream(File file, boolean append, boolean alwaysCreate)(Code) | | 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).
Parameters: file - the file to create. Parameters: append - if true append rather than replace. Parameters: alwaysCreate - if true create the file even if nothing to write. |
open | public void open() throws IOException(Code) | | Explicitly open the file for writing.
Returns silently if the file has already been opened.
throws: IOException - if there is an error. |
write | public void write(byte[] b) throws IOException(Code) | | Delegates to the three-arg version.
Parameters: b - the bytearray to write. throws: IOException - if there is a problem. |
write | public synchronized void write(byte[] b, int offset, int len) throws IOException(Code) | | Write part of a byte array.
Parameters: b - the byte array. Parameters: offset - write from this index. Parameters: len - the number of bytes to write. throws: IOException - if there is a probem. |
write | public synchronized void write(int b) throws IOException(Code) | | Write a byte.
Parameters: b - the byte to write. throws: IOException - if there is a problem. |
|
|