Class InputStreamReaderSource

java.lang.Object
org.codehaus.groovy.control.io.AbstractReaderSource
org.codehaus.groovy.control.io.InputStreamReaderSource
All Implemented Interfaces:
HasCleanup, ReaderSource

public class InputStreamReaderSource extends AbstractReaderSource
A ReaderSource for source strings.
  • Constructor Details

    • InputStreamReaderSource

      public InputStreamReaderSource(InputStream stream, CompilerConfiguration configuration)
      Creates the ReaderSource from a File descriptor.
      Parameters:
      stream - stream containing source
      configuration - configuration for compiling source
  • Method Details

    • getReader

      public Reader getReader() throws IOException
      Returns a new Reader on the underlying source object.
      Returns:
      the reader to the resource
      Throws:
      IOException - if there was an error opening for stream
    • canReopenSource

      public boolean canReopenSource()
      Returns true if the source can be restarted (ie. if getReader() will return non-null on subsequent calls.
      Specified by:
      canReopenSource in interface ReaderSource
      Overrides:
      canReopenSource in class AbstractReaderSource
      Returns:
      true if the resource can be reopened for reading
    • getURI

      public URI getURI()
      TODO: Should return the URI for this source, but we can't know what it is here.
      Returns:
      null