head 1.1; branch 1.1.1; access ; symbols DEVEL:1.1.1.1 HEAD:1.1.1; locks ; strict; comment @# @; 1.1 date 2001.03.16.18.13.13; author jallali; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.03.16.18.13.13; author jallali; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.io
Class BufferedOutputStream

    java.lang.Object
      |
      +--java.io.OutputStream
            |
            +--java.io.FilterOutputStream
                  |
                  +--java.io.BufferedOutputStream

public class BufferedOutputStream
extends FilterOutputStream

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.

See Also:
  `BufferedInputStream`

Field Summary
`protected byte[]` | `buf` The buffer containing the bytes to be written to the target InputStream.
`protected int` | `count` The total number of bytes inside the byte array `buf`.

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`BufferedOutputStream(OutputStream out)` Constructs a new BufferedOutputStream on the OutputStream `out`.
`BufferedOutputStream(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 java.io.FilterOutputStream
`close`

Methods inherited from class java.io.OutputStream
`write`

Methods inherited from class java.lang.Object
`clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### buf

    protected byte[] buf

  The buffer containing the bytes to be written to the target InputStream.

### count

    protected int count

  The total number of bytes inside the byte array `buf`.

Constructor Detail

### BufferedOutputStream

    public BufferedOutputStream(OutputStream out)

  Constructs a new BufferedOutputStream on the OutputStream `out`. The default buffer size (512 bytes) is allocated and all writes are now filtered through this stream.
  Parameters:
    `out` - the OutputStream to buffer writes on.

### BufferedOutputStream

    public BufferedOutputStream(OutputStream out,
                                int size)

  Constructs a new BufferedOutputStream on the OutputStream `out`. The buffer size is set to `size` and all writes are now filtered through this stream.
  Parameters:
    `out` - the OutputStream to buffer writes on.
    `size` - the size of the buffer in bytes.

Method Detail

### flush

    public void flush()
               throws IOException

  Flush this BufferedOutputStream to ensure all pending data is written out to the target OutputStream. In addition, the target stream is also flushed.
  Overrides:
    flush in class FilterOutputStream
  Throws:
    IOException - If an error occurs attempting to flush this BufferedOutputStream.

### write

    public void write(byte[] buffer,
                      int offset,
                      int length)
               throws IOException

  Writes `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.
  Overrides:
    write in class FilterOutputStream
  Parameters:
    `buffer` - the buffer to be written
    `offset` - offset in buffer to get bytes
    `count` - number of bytes in buffer to write
  Throws:
    IOException - If an error occurs attempting to write to this BufferedOutputStream.
    NullPointerException - If buffer is null.
    java.lang.ArrayIndexOutOfBoundsException - If offset or count are outside of bounds.

### write

    public void write(int oneByte)
               throws IOException

  Writes the specified byte `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.
  Overrides:
    write in class FilterOutputStream
  Parameters:
    `oneByte` - the byte to be written
  Throws:
    IOException - If an error occurs attempting to write to this BufferedOutputStream.

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

@ 1.1.1.1 log @import initial @ text @@