Module 

Class Streams


  • public final class Streams
    extends java.lang.Object
    Stream utility class.
    Author:
    David M. Lloyd
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void copyStream​(java.io.InputStream input, java.io.OutputStream output)
      Copy from one stream to another.
      static void copyStream​(java.io.InputStream input, java.io.OutputStream output, boolean close)
      Copy from one stream to another.
      static void copyStream​(java.io.InputStream input, java.io.OutputStream output, boolean close, int bufferSize)
      Copy from one stream to another.
      • Methods inherited from class java.lang.Object

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

      • copyStream

        public static void copyStream​(java.io.InputStream input,
                                      java.io.OutputStream output,
                                      boolean close,
                                      int bufferSize)
                               throws java.io.IOException
        Copy from one stream to another.
        Parameters:
        input - the source stream
        output - the destination stream
        close - true if the input and output streams should be closed
        bufferSize - the buffer size
        Throws:
        java.io.IOException - if an I/O error occurs
      • copyStream

        public static void copyStream​(java.io.InputStream input,
                                      java.io.OutputStream output,
                                      boolean close)
                               throws java.io.IOException
        Copy from one stream to another. A default buffer size is assumed.
        Parameters:
        input - the source stream
        output - the destination stream
        close - true if the input and output streams should be closed
        Throws:
        java.io.IOException - if an I/O error occurs
      • copyStream

        public static void copyStream​(java.io.InputStream input,
                                      java.io.OutputStream output)
                               throws java.io.IOException
        Copy from one stream to another. A default buffer size is assumed, and both streams are closed on completion.
        Parameters:
        input - the source stream
        output - the destination stream
        Throws:
        java.io.IOException - if an I/O error occurs