Documentation of 'edu.rit.io.LineBufferedOutputStream' Java class
LineBufferedOutputStream
edu.rit.io

Class LineBufferedOutputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.io.Flushable, java.lang.AutoCloseable


    public class LineBufferedOutputStream
    extends java.io.FilterOutputStream
    Class LineBufferedOutputStream provides a line buffer layered on top of an underlying output stream. All writes to the line buffered output stream are accumulated in an internal buffer. Calling flush() on the line buffered output stream does nothing. The only times the internal buffer is flushed to the underlying output stream are when a newline byte ('\n') is written and when the line buffered output stream is closed.
    • Constructor Summary

      Constructors 
      Constructor and Description
      LineBufferedOutputStream(java.io.OutputStream out)
      Construct a new line buffered output stream.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void close()
      Close this line buffered output stream.
      void flush()
      Flush this line buffered output stream.
      void write(byte[] buf)
      Write the given byte array to this line buffered output stream.
      void write(byte[] buf, int off, int len)
      Write a portion of the given byte array to this line buffered output stream.
      void write(int b)
      Write the given byte to this line buffered output stream.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LineBufferedOutputStream

        public LineBufferedOutputStream(java.io.OutputStream out)
        Construct a new line buffered output stream.
        Parameters:
        out - Underlying output stream.
    • Method Detail

      • write

        public void write(int b)
                   throws java.io.IOException
        Write the given byte to this line buffered output stream. Only the least significant 8 bits of b are written.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        b - Byte.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • write

        public void write(byte[] buf)
                   throws java.io.IOException
        Write the given byte array to this line buffered output stream.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        buf - Byte array.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if buf is null.
        java.io.IOException - Thrown if an I/O error occurred.
      • write

        public void write(byte[] buf,
                          int off,
                          int len)
                   throws java.io.IOException
        Write a portion of the given byte array to this line buffered output stream.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        buf - Byte array.
        off - Index of first byte to write.
        len - Number of bytes to write.
        Throws:
        java.lang.NullPointerException - (unchecked exception) Thrown if buf is null.
        java.lang.IndexOutOfBoundsException - (unchecked exception) Thrown if off < 0, len < 0, or off+len > buf.length.
        java.io.IOException - Thrown if an I/O error occurred.
      • flush

        public void flush()
                   throws java.io.IOException
        Flush this line buffered output stream. The flush() method does nothing.
        Specified by:
        flush in interface java.io.Flushable
        Overrides:
        flush in class java.io.FilterOutputStream
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • close

        public void close()
                   throws java.io.IOException
        Close this line buffered output stream.
        Specified by:
        close in interface java.io.Closeable
        Specified by:
        close in interface java.lang.AutoCloseable
        Overrides:
        close in class java.io.FilterOutputStream
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.