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 protectedJnaNativePty(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)protectedJnaNativePty(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 voidclose()static JnaNativePtycurrent(TerminalProvider provider, SystemStream systemStream)protected java.io.InputStreamdoGetSlaveInput()intgetMaster()java.io.FileDescriptorgetMasterFD()java.io.InputStreamgetMasterInput()Returns the input stream for the master side of the PTY.java.io.OutputStreamgetMasterOutput()Returns the output stream for the master side of the PTY.java.lang.StringgetName()intgetSlave()java.io.FileDescriptorgetSlaveFD()intgetSlaveOut()java.io.FileDescriptorgetSlaveOutFD()java.io.OutputStreamgetSlaveOutput()Returns the output stream for the slave side of the PTY.static booleanisPosixSystemStream(SystemStream stream)static JnaNativePtyopen(TerminalProvider provider, Attributes attr, Size size)static java.lang.StringposixSystemStreamName(SystemStream stream)java.lang.StringtoString()-
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:
closein interfacejava.lang.AutoCloseable- Specified by:
closein 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:PtyReturns 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:
getMasterInputin interfacePty- Returns:
- the master's input stream
-
getMasterOutput
public java.io.OutputStream getMasterOutput()
Description copied from interface:PtyReturns 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:
getMasterOutputin interfacePty- Returns:
- the master's output stream
-
doGetSlaveInput
protected java.io.InputStream doGetSlaveInput()
- Specified by:
doGetSlaveInputin classAbstractPty
-
getSlaveOutput
public java.io.OutputStream getSlaveOutput()
Description copied from interface:PtyReturns 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:
getSlaveOutputin interfacePty- Returns:
- the slave's output stream
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isPosixSystemStream
public static boolean isPosixSystemStream(SystemStream stream)
-
posixSystemStreamName
public static java.lang.String posixSystemStreamName(SystemStream stream)
-
-