Class ShellConsole.ConsoleInputStream

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

    private static class ShellConsole.ConsoleInputStream
    extends java.io.InputStream
    JLine's ConsoleReaderInputStream is no longer public, therefore we need to use our own implementation
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean atEOF  
      private byte[] buffer  
      private ShellConsole console  
      private java.nio.charset.Charset cs  
      private int cursor  
      private static byte[] EMPTY  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private boolean ensureInput()  
      int read()  
      int read​(byte[] b, int off, int len)  
      private int readNextLine()  
      • Methods inherited from class java.io.InputStream

        available, close, mark, markSupported, nullInputStream, read, readAllBytes, readNBytes, readNBytes, reset, skip, transferTo
      • Methods inherited from class java.lang.Object

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

      • EMPTY

        private static final byte[] EMPTY
      • cs

        private final java.nio.charset.Charset cs
      • buffer

        private byte[] buffer
      • cursor

        private int cursor
      • atEOF

        private boolean atEOF
    • Constructor Detail

      • ConsoleInputStream

        public ConsoleInputStream​(ShellConsole console,
                                  java.nio.charset.Charset cs)
    • Method Detail

      • read

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

        public int read()
                 throws java.io.IOException
        Specified by:
        read in class java.io.InputStream
        Throws:
        java.io.IOException
      • ensureInput

        private boolean ensureInput()
                             throws java.io.IOException
        Throws:
        java.io.IOException
      • readNextLine

        private int readNextLine()
                          throws java.io.IOException
        Throws:
        java.io.IOException