Terminal interface represents the slave
side of a PTY, but implementations derived from this class
will handle both the slave and master side of things.
In order to correctly handle line discipline, the terminal
needs to read the input in advance in order to raise the
signals as fast as possible.
For example, when the user hits Ctrl+C, we can't wait until
the application consumes all the read events.
The same applies to echoing, when enabled, as the echoing
has to happen as soon as the user hit the keyboard, and not
only when the application running in the terminal processes
the input.
| Modifier and Type | Class and Description |
|---|---|
| private class |
| Modifier and Type | Field and Description |
|---|---|
| protected final Attributes | attributes
Console data |
| protected final OutputStream | |
| private static final int | |
| protected final Size | |
| protected boolean | |
| protected final NonBlockingPumpInputStream | |
| protected final OutputStream | |
| protected final OutputStream | |
| protected final NonBlockingReader | |
| protected final PrintWriter |
| Access | Constructor and Description |
|---|---|
| public | |
| public | LineDisciplineTerminal(String name, String type, OutputStream masterOutput, Charset encoding, Terminal.
|
| Modifier and Type | Method and Description |
|---|---|
| private static int | |
| protected void | |
| protected boolean | |
| public Attributes | getAttributes()
Implements jdk. Returns the terminal attributes. |
| private static Attributes | |
| public TerminalProvider | getProvider()
Implements jdk. Returns the |
| public Size | getSize()
Implements jdk. Retrieve the size of the visible window |
| public SystemStream | getSystemStream()
Implements jdk. The underlying system stream, may be |
| public InputStream | input()
Implements jdk. Retrieve the input stream for this terminal. |
| public OutputStream | output()
Implements jdk. Retrieve the output stream for this terminal. |
| public void | |
| public void | |
| public void | |
| protected void | |
| protected void | |
| public void | raise(Terminal.
Overrides jdk. Implements jdk. Raise the specific signal. |
| public NonBlockingReader | reader()
Implements jdk. Retrieve the |
| public void | setAttributes(Attributes attr)
Implements jdk. Set the terminal attributes. |
| public void | |
| public PrintWriter | writer()
Implements jdk. Retrieve the |
| attributes | back to summary |
|---|---|
| protected final Attributes attributes Console data | |
| masterOutput | back to summary |
|---|---|
| protected final OutputStream masterOutput | |
| PIPE_SIZE | back to summary |
|---|---|
| private static final int PIPE_SIZE | |
| size | back to summary |
|---|---|
| protected final Size size | |
| skipNextLf | back to summary |
|---|---|
| protected boolean skipNextLf | |
| slaveInput | back to summary |
|---|---|
| protected final NonBlockingPumpInputStream slaveInput | |
| slaveInputPipe | back to summary |
|---|---|
| protected final OutputStream slaveInputPipe | |
| slaveOutput | back to summary |
|---|---|
| protected final OutputStream slaveOutput | |
| slaveReader | back to summary |
|---|---|
| protected final NonBlockingReader slaveReader | |
| slaveWriter | back to summary |
|---|---|
| protected final PrintWriter slaveWriter | |
| LineDisciplineTerminal | back to summary |
|---|---|
| public LineDisciplineTerminal(String name, String type, OutputStream masterOutput, Charset encoding) throws IOException | |
| LineDisciplineTerminal | back to summary |
|---|---|
public LineDisciplineTerminal(String name, String type, OutputStream masterOutput, Charset encoding, Terminal.
| |
| ctrl | back to summary |
|---|---|
| private static int ctrl(char c) | |
| doClose | back to summary |
|---|---|
| protected void doClose() throws IOException Overrides jdk. | |
| doProcessInputByte | back to summary |
|---|---|
| protected boolean doProcessInputByte(int c) throws IOException | |
| getAttributes | back to summary |
|---|---|
| public Attributes getAttributes() Implements jdk. Doc from jdk. Returns the terminal attributes.
The returned object can be safely modified
further used in a call to | |
| getDefaultTerminalAttributes | back to summary |
|---|---|
| private static Attributes getDefaultTerminalAttributes() | |
| getProvider | back to summary |
|---|---|
| public TerminalProvider getProvider() Implements jdk. Doc from jdk. Returns the
| |
| getSize | back to summary |
|---|---|
| public Size getSize() Implements jdk. Doc from jdk. Retrieve the size of the visible window | |
| getSystemStream | back to summary |
|---|---|
| public SystemStream getSystemStream() Implements jdk. Doc from jdk. The underlying system stream, may be
| |
| input | back to summary |
|---|---|
| public InputStream input() Implements jdk. Doc from jdk. Retrieve the input stream for this terminal.
In some rare cases, there may be a need to access the
terminal input stream directly. In the usual cases,
use the
| |
| output | back to summary |
|---|---|
| public OutputStream output() Implements jdk. Doc from jdk. Retrieve the output stream for this terminal.
In some rare cases, there may be a need to access the
terminal output stream directly. In the usual cases,
use the
| |
| processInputByte | back to summary |
|---|---|
| public void processInputByte(int c) throws IOException Master input processing. All data coming to the terminal should be provided using this method.
| |
| processInputBytes | back to summary |
|---|---|
| public void processInputBytes(byte[] input) throws IOException | |
| processInputBytes | back to summary |
|---|---|
| public void processInputBytes(byte[] input, int offset, int length) throws IOException | |
| processIOException | back to summary |
|---|---|
| protected void processIOException(IOException ioException) | |
| processOutputByte | back to summary |
|---|---|
| protected void processOutputByte(int c) throws IOException Master output processing. All data going to the master should be provided by this method.
| |
| raise | back to summary |
|---|---|
| public void raise(Terminal. Overrides jdk. Implements jdk. Doc from jdk. Raise the specific signal.
This is not method usually called by non system terminals.
When accessing a terminal through a SSH or Telnet connection, signals may be
conveyed by the protocol and thus need to be raised when reaching the terminal code.
The terminals do that automatically when the terminal input stream has a character
mapped to
| |
| reader | back to summary |
|---|---|
| public NonBlockingReader reader() Implements jdk. Doc from jdk. Retrieve the | |
| setAttributes | back to summary |
|---|---|
| public void setAttributes(Attributes attr) Implements jdk. Doc from jdk. Set the terminal attributes. The terminal will perform a copy of the given attributes. | |
| setSize | back to summary |
|---|---|
| public void setSize(Size sz) Implements jdk. | |
| writer | back to summary |
|---|---|
| public PrintWriter writer() Implements jdk. Doc from jdk. Retrieve the | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Overrides java. Implements java. Closes this output stream and releases any system resources associated with this stream. |
| public void | flush()
Overrides java. Implements java. Flushes this output stream and forces any buffered output bytes to be written out. |
| public void | write(int b)
Implements abstract java. Writes the specified byte to this output stream. |
| public void | write(byte[] b, int off, int len)
Overrides java. Writes |
| FilteringOutputStream | back to summary |
|---|---|
| private FilteringOutputStream() | |
| close | back to summary |
|---|---|
| public void close() throws IOException Overrides java. Implements java. Doc from java. Closes this output stream and releases any system resources
associated with this stream. The general contract of
| |
| flush | back to summary |
|---|---|
| public void flush() throws IOException Overrides java. Implements java. Doc from java. Flushes this output stream and forces any buffered output bytes
to be written out. The general contract of If the intended destination of this stream is an abstraction provided by the underlying operating system, for example a file, then flushing the stream guarantees only that bytes previously written to the stream are passed to the operating system for writing; it does not guarantee that they are actually written to a physical device such as a disk drive.
| |
| write | back to summary |
|---|---|
| public void write(int b) throws IOException Implements abstract java. Doc from java. Writes the specified byte to this output stream. The general
contract for
| |
| write | back to summary |
|---|---|
| public void write(byte[] b, int off, int len) throws IOException Overrides java. Doc from java. Writes
If
If
| |