Class Source.InputStreamSource

java.lang.Object
org.jline.builtins.Source.InputStreamSource
All Implemented Interfaces:
Source
Direct Known Subclasses:
Source.StdInSource
Enclosing interface:
Source

public static class Source.InputStreamSource extends Object implements Source
A Source implementation that reads from an InputStream.
  • Constructor Details

    • InputStreamSource

      public InputStreamSource(InputStream in, boolean close, String name)
  • Method Details

    • getName

      public String getName()
      Description copied from interface: Source
      Gets the name of this source.
      Specified by:
      getName in interface Source
      Returns:
      the name of the source
    • read

      public InputStream read() throws IOException
      Description copied from interface: Source
      Opens a stream to read the content of this source.
      Specified by:
      read in interface Source
      Returns:
      an input stream for reading the source content
      Throws:
      IOException - if an I/O error occurs
    • lines

      public Long lines()
      Description copied from interface: Source
      Gets the number of lines in this source, if known.
      Specified by:
      lines in interface Source
      Returns:
      the number of lines, or null if unknown