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
    • 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