Class NewlineOutput

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public final class NewlineOutput
    extends PrintOutput
    This class is a wrapper for outputting text with specific newline characters.
    Author:
    BaseX Team 2005-24, BSD License, Christian Gruen
    • Constructor Detail

      • NewlineOutput

        public NewlineOutput​(PrintOutput po,
                             byte[] newline)
        Constructor, given an output stream.
        Parameters:
        po - output stream reference
        newline - newline string
    • Method Detail

      • print

        public void print​(int cp)
                   throws IOException
        Description copied from class: PrintOutput
        Prints a single codepoint, and keeps track of the current line length.
        Overrides:
        print in class PrintOutput
        Parameters:
        cp - codepoint to be printed
        Throws:
        IOException - I/O exception
      • finished

        public boolean finished()
        Description copied from class: PrintOutput
        Checks if the output stream is exhausted.
        Overrides:
        finished in class PrintOutput
        Returns:
        true if stream is exhausted