    All Packages    This Package    Previous    Next

# Class java.io.BufferedOutputStream

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

public class BufferedOutputStream
extends FilterOutputStream

A buffered output stream. This stream lets you write characters to a stream without causing a write every time. The data is first written into a buffer. It is written to the actual stream when the buffer is full, or when the stream is flushed.

Version:
  1.12, 31 Jan 1995
Author:
  Arthur van Hoff

##

buf
  The buffer.
count
  The number of bytes in the buffer.

##

BufferedOutputStream(OutputStream)
  Creates a new buffered stream with a default buffer size.
BufferedOutputStream(OutputStream, int)
  Creates a new buffered stream with a given buffer size.

##

flush()
  Flushes the stream.
write(int)
  Writes a byte.
write(byte[], int, int)
  Writes a sub array of bytes.

##

buf

      protected byte buf[]

  The buffer.

count

      protected int count

  The number of bytes in the buffer.

##

BufferedOutputStream

      public BufferedOutputStream(OutputStream out)

  Creates a new buffered stream with a default buffer size.
  Parameters:
    in - the input stream

BufferedOutputStream

      public BufferedOutputStream(OutputStream out,
                                  int size)

  Creates a new buffered stream with a given buffer size.
  Parameters:
    in - the input stream
    size - the buffer size

##

write

      public synchronized void write(int b)

  Writes a byte. Will block until the byte is actually written.
  Throws: IOException
    i/o error occurred
  Overrides:
    write in class FilterOutputStream

write

      public synchronized void write(byte b[],
                                     int off,
                                     int len)

  Writes a sub array of bytes. To be efficient it should be overridden in a subclass.
  Parameters:
    b - the data to be written
    off - the start offset in the data
    len - the number of bytes that are written
  Throws: IOException
    i/o error occurred
  Overrides:
    write in class FilterOutputStream

flush

      public synchronized void flush()

  Flushes the stream. This will write any buffered output bytes.
  Throws: IOException
    i/o error occurred
  Overrides:
    flush in class FilterOutputStream

    All Packages    This Package    Previous    Next