Class CopyReader


  • public class CopyReader
    extends java.lang.Object
    Copies a Reader into a String.
    • Constructor Summary

      Constructors 
      Constructor Description
      CopyReader​(@NotNull java.io.Reader reader)
      Creates a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      @Nullable java.lang.String getFailure()
      Returns the failure reason.
      @NotNull java.lang.String getOutput()
      Returns the reader's output.
      void join()
      Waits for the worker thread to terminate.
      void start()
      Starts reading.
      void stop()
      Stops reading.
      • Methods inherited from class java.lang.Object

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

      • CopyReader

        public CopyReader​(@NotNull
                          @NotNull java.io.Reader reader)
        Creates a new instance.
        Parameters:
        reader - the reader to read from
    • Method Detail

      • start

        public void start()
        Starts reading.
      • stop

        public void stop()
        Stops reading.
      • getFailure

        @Nullable
        public @Nullable java.lang.String getFailure()
        Returns the failure reason.
        Returns:
        the failure reason or null if no failure occurred
      • getOutput

        @NotNull
        public @NotNull java.lang.String getOutput()
        Returns the reader's output.
        Returns:
        the reader's output
      • join

        public void join()
                  throws java.lang.InterruptedException
        Waits for the worker thread to terminate.
        Throws:
        java.lang.InterruptedException - if the current thread was interrupted waiting for the worker thread to terminate