Package 

Class InputStreamExtensionsKt

    • Method Summary

      Modifier and Type Method Description
      final static String readTextAndClose(InputStream $self, Charset charset)
      final static Long copyTo(InputStream $self, OutputStream out, Integer bufferSize, Function0<Boolean> shouldCancel) Copies this stream to the given output stream, returning the number of bytes copied.
      • Methods inherited from class java.lang.Object

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

      • copyTo

         final static Long copyTo(InputStream $self, OutputStream out, Integer bufferSize, Function0<Boolean> shouldCancel)

        Copies this stream to the given output stream, returning the number of bytes copied.

        Note It is the caller's responsibility to close both of these resources.

        Parameters:
        out - The output stream to copy to
        bufferSize - The buffer size to use.
        shouldCancel - Check to indicate if the stream should be cancelled