|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
java.io.FilterOutputStream
org.apache.cocoon.util.BufferedOutputStream
public class BufferedOutputStream
This class is similar to the BufferedOutputStream
. In
addition it provides an increasing buffer, the possibility to reset the
buffer and it counts the number of bytes written to the output stream.
Field Summary |
---|
Fields inherited from class java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
BufferedOutputStream(OutputStream out)
Creates a new buffered output stream to write data to the specified underlying output stream with a default flush buffer size of 32768 bytes and a default initial buffer size of 8192 bytes. |
|
BufferedOutputStream(OutputStream out,
int flushBufferSize)
Creates a new buffered output stream to write data to the specified underlying output stream with the specified flush buffer size and a default initial buffer size of 8192 bytes. |
|
BufferedOutputStream(OutputStream out,
int flushBufferSize,
int initialBufferSize)
Creates a new buffered output stream to write data to the specified underlying output stream with the specified buffer sizes. |
Method Summary | |
---|---|
void |
clearBuffer()
Deprecated. Public access is deprecated. Use reset() instead. |
void |
close()
Closes this buffered output stream. |
void |
flush()
Flushes this buffered output stream. |
int |
getCount()
Return the size of the current buffer |
boolean |
isResettable()
|
void |
reset()
Reset the BufferedOutputStream to the last flush() . |
void |
write(byte[] b,
int off,
int len)
Writes len bytes from the specified byte array
starting at offset off to this buffered output stream. |
void |
write(int b)
Writes the specified byte to this buffered output stream. |
Methods inherited from class java.io.FilterOutputStream |
---|
write |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BufferedOutputStream(OutputStream out)
out
- the underlying output stream.public BufferedOutputStream(OutputStream out, int flushBufferSize)
out
- the underlying output stream.public BufferedOutputStream(OutputStream out, int flushBufferSize, int initialBufferSize)
out
- the underlying output stream.flushBufferSize
- the buffer size when the stream is flushed. Must
be greater than 0 or -1 meaning the stream never
flushes itself.initialBufferSize
- the initial buffer size. Must be greater than 0.
Will be limited to the flush buffer size.Method Detail |
---|
public void write(int b) throws IOException
write
in class FilterOutputStream
b
- the byte to be written.
IOException
- if an I/O error occurs.public void write(byte[] b, int off, int len) throws IOException
len
bytes from the specified byte array
starting at offset off
to this buffered output stream.
Ordinarily this method stores bytes from the given array into this
stream's buffer, flushing the buffer to the underlying output stream as
needed. If the requested length is at least as large as this stream's
buffer, however, then this method will flush the buffer and write the
bytes directly to the underlying output stream. Thus redundant
BufferedOutputStream
s will not copy data unnecessarily.
write
in class FilterOutputStream
b
- the data.off
- the start offset in the data.len
- the number of bytes to write.
IOException
- if an I/O error occurs.public void flush() throws IOException
flush
in interface Flushable
flush
in class FilterOutputStream
IOException
- if an I/O error occurs.public void close() throws IOException
close
in interface Closeable
close
in class FilterOutputStream
IOException
- if an I/O error occurs.public void clearBuffer()
reset()
instead.
public void reset()
flush()
.
public boolean isResettable()
public int getCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |