Class Streams

java.lang.Object
org.xnio.streams.Streams

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

    • copyStream

      public static void copyStream(InputStream input, OutputStream output, boolean close, int bufferSize) throws 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:
      IOException - if an I/O error occurs
    • copyStream

      public static void copyStream(InputStream input, OutputStream output, boolean close) throws 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:
      IOException - if an I/O error occurs
    • copyStream

      public static void copyStream(InputStream input, OutputStream output) throws 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:
      IOException - if an I/O error occurs