Class TtyFilterInputStream

  • All Implemented Interfaces:
    java.io.Closeable, java.lang.AutoCloseable

    public class TtyFilterInputStream
    extends java.io.FilterInputStream
    Handles the input while taking into account the PtyModes for handling CR / LF
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int available()  
      protected int handleCR()  
      protected int handleLF()  
      protected Buffer insertCharacter​(Buffer org, int c)  
      int read()  
      int read​(byte[] b, int off, int len)  
      protected int readRawInput()  
      void write​(byte[] buf, int off, int len)  
      void write​(int c)  
      • Methods inherited from class java.io.FilterInputStream

        close, mark, markSupported, read, reset, skip
      • Methods inherited from class java.io.InputStream

        nullInputStream, readAllBytes, readNBytes, readNBytes, transferTo
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • INPUT_OPTIONS

        public static final java.util.Set<PtyMode> INPUT_OPTIONS
      • ttyOptions

        private final java.util.Set<PtyMode> ttyOptions
      • buffer

        private Buffer buffer
      • lastChar

        private int lastChar
    • Constructor Detail

      • TtyFilterInputStream

        public TtyFilterInputStream​(java.io.InputStream in,
                                    java.util.Map<PtyMode,​?> modes)
      • TtyFilterInputStream

        public TtyFilterInputStream​(java.io.InputStream in,
                                    java.util.Collection<PtyMode> ttyOptions)
    • Method Detail

      • write

        public void write​(int c)
      • write

        public void write​(byte[] buf,
                          int off,
                          int len)
      • available

        public int available()
                      throws java.io.IOException
        Overrides:
        available in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • read

        public int read()
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException
      • handleCR

        protected int handleCR()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • handleLF

        protected int handleLF()
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • insertCharacter

        protected Buffer insertCharacter​(Buffer org,
                                         int c)
      • readRawInput

        protected int readRawInput()
                            throws java.io.IOException
        Throws:
        java.io.IOException
      • read

        public int read​(byte[] b,
                        int off,
                        int len)
                 throws java.io.IOException
        Overrides:
        read in class java.io.FilterInputStream
        Throws:
        java.io.IOException