Package org.jline.terminal.impl.jna
Class JnaNativePty
- java.lang.Object
-
- org.jline.terminal.impl.AbstractPty
-
- org.jline.terminal.impl.jna.JnaNativePty
-
- All Implemented Interfaces:
java.io.Closeable
,java.lang.AutoCloseable
,Pty
- Direct Known Subclasses:
FreeBsdNativePty
,LinuxNativePty
,OsXNativePty
,SolarisNativePty
public abstract class JnaNativePty extends AbstractPty implements Pty
-
-
Field Summary
-
Fields inherited from class org.jline.terminal.impl.AbstractPty
provider, systemStream
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, int slaveOut, java.io.FileDescriptor slaveOutFD, java.lang.String name)
protected
JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, java.lang.String name)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
static JnaNativePty
current(TerminalProvider provider, SystemStream systemStream)
protected java.io.InputStream
doGetSlaveInput()
int
getMaster()
java.io.FileDescriptor
getMasterFD()
java.io.InputStream
getMasterInput()
Returns the input stream for the master side of the PTY.java.io.OutputStream
getMasterOutput()
Returns the output stream for the master side of the PTY.java.lang.String
getName()
int
getSlave()
java.io.FileDescriptor
getSlaveFD()
int
getSlaveOut()
java.io.FileDescriptor
getSlaveOutFD()
java.io.OutputStream
getSlaveOutput()
Returns the output stream for the slave side of the PTY.static boolean
isPosixSystemStream(SystemStream stream)
static JnaNativePty
open(TerminalProvider provider, Attributes attr, Size size)
static java.lang.String
posixSystemStreamName(SystemStream stream)
java.lang.String
toString()
-
Methods inherited from class org.jline.terminal.impl.AbstractPty
checkInterrupted, doSetAttr, getProvider, getSlaveInput, getSystemStream, newDescriptor, setAttr
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.jline.terminal.spi.Pty
getAttr, getProvider, getSize, getSlaveInput, getSystemStream, setAttr, setSize
-
-
-
-
Constructor Detail
-
JnaNativePty
protected JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, java.lang.String name)
-
JnaNativePty
protected JnaNativePty(TerminalProvider provider, SystemStream systemStream, int master, java.io.FileDescriptor masterFD, int slave, java.io.FileDescriptor slaveFD, int slaveOut, java.io.FileDescriptor slaveOutFD, java.lang.String name)
-
-
Method Detail
-
current
public static JnaNativePty current(TerminalProvider provider, SystemStream systemStream) throws java.io.IOException
- Throws:
java.io.IOException
-
open
public static JnaNativePty open(TerminalProvider provider, Attributes attr, Size size) throws java.io.IOException
- Throws:
java.io.IOException
-
close
public void close() throws java.io.IOException
- Specified by:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
getMaster
public int getMaster()
-
getSlave
public int getSlave()
-
getSlaveOut
public int getSlaveOut()
-
getName
public java.lang.String getName()
-
getMasterFD
public java.io.FileDescriptor getMasterFD()
-
getSlaveFD
public java.io.FileDescriptor getSlaveFD()
-
getSlaveOutFD
public java.io.FileDescriptor getSlaveOutFD()
-
getMasterInput
public java.io.InputStream getMasterInput()
Description copied from interface:Pty
Returns the input stream for the master side of the PTY.This stream receives data that has been written to the slave's output stream. Terminal emulators typically read from this stream to get the output from processes running in the terminal.
- Specified by:
getMasterInput
in interfacePty
- Returns:
- the master's input stream
-
getMasterOutput
public java.io.OutputStream getMasterOutput()
Description copied from interface:Pty
Returns the output stream for the master side of the PTY.Data written to this stream will be available for reading from the slave's input stream. Terminal emulators typically write to this stream to send input to processes running in the terminal.
- Specified by:
getMasterOutput
in interfacePty
- Returns:
- the master's output stream
-
doGetSlaveInput
protected java.io.InputStream doGetSlaveInput()
- Specified by:
doGetSlaveInput
in classAbstractPty
-
getSlaveOutput
public java.io.OutputStream getSlaveOutput()
Description copied from interface:Pty
Returns the output stream for the slave side of the PTY.Data written to this stream will be available for reading from the master's input stream. Processes running in the terminal write to this stream to produce their output.
- Specified by:
getSlaveOutput
in interfacePty
- Returns:
- the slave's output stream
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
isPosixSystemStream
public static boolean isPosixSystemStream(SystemStream stream)
-
posixSystemStreamName
public static java.lang.String posixSystemStreamName(SystemStream stream)
-
-