|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.OutputStream
oracle.adfnmc.java.io.FilterOutputStream
oracle.adfnmc.java.io.BufferedOutputStream
public class BufferedOutputStream
BufferedOutputStream is a class which takes an output stream and buffers the writes to that stream. In this way, costly interaction with the original output stream can be minimized by writing buffered amounts of data infrequently. The drawback is that extra space is required to hold the buffer and copying takes place when writing that buffer.
BufferedInputStream
Field Summary | |
---|---|
protected byte[] |
buf
The buffer containing the bytes to be written to the target OutputStream. |
protected int |
count
The total number of bytes inside the byte array buf . |
Fields inherited from class oracle.adfnmc.java.io.FilterOutputStream |
---|
out |
Constructor Summary | |
---|---|
BufferedOutputStream(java.io.OutputStream out)
Constructs a new BufferedOutputStream on the OutputStream out . |
|
BufferedOutputStream(java.io.OutputStream out,
int size)
Constructs a new BufferedOutputStream on the OutputStream out . |
Method Summary | |
---|---|
void |
flush()
Flush this BufferedOutputStream to ensure all pending data is written out to the target OutputStream. |
void |
write(byte[] buffer,
int offset,
int length)
Writes count bytes from the byte array buffer starting at
offset to this BufferedOutputStream. |
void |
write(int oneByte)
Writes the specified byte oneByte to this BufferedOutputStream. |
Methods inherited from class oracle.adfnmc.java.io.FilterOutputStream |
---|
close, write |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected byte[] buf
protected int count
buf
.
Constructor Detail |
---|
public BufferedOutputStream(java.io.OutputStream out)
out
. The default buffer size (8Kb) is
allocated and all writes are now filtered through this stream.
out
- the OutputStream to buffer writes on.public BufferedOutputStream(java.io.OutputStream out, int size)
out
. The buffer size is set to
size
and all writes are now filtered through this stream.
out
- the OutputStream to buffer writes on.size
- the size of the buffer in bytes.
java.lang.IllegalArgumentException
- the size is <= 0Method Detail |
---|
public void flush() throws java.io.IOException
flush
in class FilterOutputStream
java.io.IOException
- If an error occurs attempting to flush this BufferedOutputStream.public void write(byte[] buffer, int offset, int length) throws java.io.IOException
count
bytes
from the byte array buffer
starting at
offset
to this BufferedOutputStream. If there is room in the buffer to hold the bytes, they are copied
in. If not, the buffered bytes plus the bytes in buffer
are written to the target stream, the target
is flushed, and the buffer is cleared.
write
in class FilterOutputStream
buffer
- the buffer to be writtenoffset
- offset in buffer to get byteslength
- number of bytes in buffer to write
java.io.IOException
- If an error occurs attempting to write to this BufferedOutputStream.
java.lang.NullPointerException
- If buffer is null.
java.lang.ArrayIndexOutOfBoundsException
- If offset or count is outside of bounds.public void write(int oneByte) throws java.io.IOException
oneByte
to this BufferedOutputStream. Only the low order byte of
oneByte
is written. If there is room in the buffer, the byte is copied in and the count incremented.
Otherwise, the buffer plus oneByte
are written to the target stream, the target is flushed, and the
buffer is reset.
write
in class FilterOutputStream
oneByte
- the byte to be written
java.io.IOException
- If an error occurs attempting to write to this BufferedOutputStream.
|
Oracle Fusion Middleware Java API Reference for Oracle ADF Mobile Client 11g Release 1 (11.1.1) E17503-02 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |