|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.io.OutputStream org.apache.cocoon.bean.helpers.DelayedOutputStream
public class DelayedOutputStream
A output stream writing to a ByteArrayOutputStream, until an OutputStream target is defined.
Constructor Summary | |
---|---|
DelayedOutputStream()
Constructor for the DelayedFileOutputStream object, create a ByteArrayOutputStream only |
Method Summary | |
---|---|
void |
close()
Close ByteArrayOutputStrem, and FileOutputStream, depending on inner state of this stream |
void |
flush()
Flush ByteArrayOutputStrem, writing content to FileOutputStream, flush FileOutputStream |
byte[] |
getContent()
Return the contents of the stream as a byte array |
void |
setFileOutputStream(OutputStream outputStream)
Creates a file output stream to write to the file represented by the specified File object. |
int |
size()
Gets the size of the content of the current output stream |
void |
write(byte[] b)
Write into ByteArrayOutputStrem, or FileOutputStream, depending on inner state of this stream |
void |
write(byte[] b,
int off,
int len)
Write into ByteArrayOutputStrem, or FileOutputStream, depending on inner state of this stream |
void |
write(int b)
Write into ByteArrayOutputStrem, or FileOutputStream, depending on inner state of this stream |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DelayedOutputStream()
Method Detail |
---|
public void setFileOutputStream(OutputStream outputStream) throws FileNotFoundException
outputStream
- The new fileOutputStream value
FileNotFoundException
- thrown if creating of FileOutputStream failspublic void write(int b) throws IOException
write
in class OutputStream
b
- Description of Parameter
IOException
- thrown iff implicitly flush of baos to fos fails, or writing
of baos, or fos failspublic void write(byte[] b) throws IOException
write
in class OutputStream
b
- Description of Parameter
IOException
- thrown iff implicitly flush of baos to fos fails, or writing
of baos, or fos failspublic void write(byte[] b, int off, int len) throws IOException
write
in class OutputStream
b
- Description of Parameteroff
- Description of Parameterlen
- Description of Parameter
IOException
- thrown iff implicitly flush of baos to fos fails, or writing
of baos, or fos failspublic void close() throws IOException
close
in interface Closeable
close
in class OutputStream
IOException
- thrown iff implicitly flush of baos to fos fails, or closing
of baos, or fos failspublic void flush() throws IOException
flush
in interface Flushable
flush
in class OutputStream
IOException
- thrown iff implicitly flush of baos to fos fails, or flushing
of baos, or fos failspublic int size()
public byte[] getContent()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |