Class IOUtils


  • public final class IOUtils
    extends Object
    • Method Detail

      • copy

        public static long copy​(InputStream in,
                                OutputStream out,
                                long length)
                         throws StreamCopyException
        Copy bytes between streams. This method supports the ReadFromSupport interface. It will not call Closeable.close() on either of the two streams.
        Parameters:
        in - the stream to read bytes from
        out - the stream to write bytes to
        length - the maximum number of bytes to copy, or -1 to copy an unlimited number of bytes
        Returns:
        the number of bytes copied
        Throws:
        StreamCopyException - if a read/write operation on one of the streams triggered an IOException