Class StyledDocumentOutputStream

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

    public class StyledDocumentOutputStream
    extends java.io.PrintStream
    A stream that prints in a styled document (of a text pane).
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected javax.swing.text.StyledDocument doc
      The document.
      protected javax.swing.text.Style style
      The style.
      • Fields inherited from class java.io.FilterOutputStream

        out
    • Constructor Summary

      Constructors 
      Constructor Description
      StyledDocumentOutputStream​(javax.swing.text.StyledDocument doc, javax.swing.text.Style style)
      Create a new
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void write​(byte[] b)
      Write a byte array to the document.
      void write​(byte[] b, int off, int len)
      Write a byte to the document.
      void write​(int b)
      Write a byte to the document.
      • Methods inherited from class java.io.PrintStream

        append, append, append, checkError, clearError, close, flush, format, format, print, print, print, print, print, print, print, print, print, printf, printf, println, println, println, println, println, println, println, println, println, println, setError
      • Methods inherited from class java.io.OutputStream

        nullOutputStream
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • doc

        protected javax.swing.text.StyledDocument doc
        The document.
      • style

        protected javax.swing.text.Style style
        The style.
    • Constructor Detail

      • StyledDocumentOutputStream

        public StyledDocumentOutputStream​(javax.swing.text.StyledDocument doc,
                                          javax.swing.text.Style style)
        Create a new
    • Method Detail

      • write

        public void write​(int b)
        Write a byte to the document.
        Overrides:
        write in class java.io.PrintStream
        Parameters:
        b - The byte.
      • write

        public void write​(byte[] b)
                   throws java.io.IOException
        Write a byte array to the document.
        Overrides:
        write in class java.io.FilterOutputStream
        Parameters:
        b - The byte array.
        Throws:
        java.io.IOException
      • write

        public void write​(byte[] b,
                          int off,
                          int len)
        Write a byte to the document.
        Overrides:
        write in class java.io.PrintStream
        Parameters:
        b - The byte array.
        off - The offset.
        len - The length.