Package java.io

Class FilterOutputStream

    • Field Detail

      • out

        protected OutputStream out
        The target output stream for this filter stream.
    • Constructor Detail

      • FilterOutputStream

        public FilterOutputStream​(OutputStream out)
        Constructs a new FilterOutputStream with out as its target stream.
        Parameters:
        out - the target stream that this stream writes to.
    • Method Detail

      • flush

        public void flush()
                   throws IOException
        Ensures that all pending data is sent out to the target stream. This implementation flushes the target stream.
        Specified by:
        flush in interface Flushable
        Overrides:
        flush in class OutputStream
        Throws:
        IOException - if an error occurs attempting to flush this stream.
      • write

        public void write​(byte[] buffer,
                          int offset,
                          int length)
                   throws IOException
        Writes count bytes from the byte array buffer starting at offset to the target stream.
        Overrides:
        write in class OutputStream
        Parameters:
        buffer - the buffer to write.
        offset - the index of the first byte in buffer to write.
        length - the number of bytes in buffer to write.
        Throws:
        IndexOutOfBoundsException - if offset < 0 or count < 0, or if offset + count is bigger than the length of buffer.
        IOException - if an I/O error occurs while writing to this stream.
      • write

        public void write​(int oneByte)
                   throws IOException
        Writes one byte to the target stream. Only the low order byte of the integer oneByte is written.
        Specified by:
        write in class OutputStream
        Parameters:
        oneByte - the byte to be written.
        Throws:
        IOException - if an I/O error occurs while writing to this stream.