Class JepOutputStream

  • All Implemented Interfaces:
    Closeable, Flushable, AutoCloseable

    public class JepOutputStream
    extends OutputStream
    For redirecting output from the Python stdout/stderr to Java.
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    • Field Detail

      • m_StdOut

        protected boolean m_StdOut
        whether stdout or stderr.
      • m_Console

        protected adams.gui.core.ConsolePanel.ConsolePanelOutputStream m_Console
        the output stream for the console panel.
    • Constructor Detail

      • JepOutputStream

        public JepOutputStream​(boolean stdout)
        Initializes the output stream.
        Parameters:
        stdout - whether this is for stdout or stderr
    • Method Detail

      • isStdOut

        public boolean isStdOut()
        Returns whether for stdout or stderr.
        Returns:
        true if stdout
      • write

        public void write​(int b)
                   throws IOException
        Writes the specified byte to this output stream. The general contract for write is that one byte is written to the output stream. The byte to be written is the eight low-order bits of the argument b. The 24 high-order bits of b are ignored.
        Specified by:
        write in class OutputStream
        Parameters:
        b - the byte.
        Throws:
        IOException - if an I/O error occurs. In particular, an IOException may be thrown if the output stream has been closed.