Class StreamUtils


  • public abstract class StreamUtils
    extends java.lang.Object

    StreamUtils class.

    • Constructor Summary

      Constructors 
      Constructor Description
      StreamUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void streamToStream​(java.io.InputStream in, java.io.OutputStream out)
      Convenience method for reading data from an InputStream and then immediately writing that data to an OutputStream with a default buffer size of one kilobyte (1,024 bytes).
      static void streamToStream​(java.io.InputStream in, java.io.OutputStream out, int bufferSize)
      Convenience method for reading data from an InputStream and then immediately writing that data to an OutputStream.
      static void streamToStream​(java.io.Reader in, java.io.Writer out)
      Convenience method for reading data from a Reader and then immediately writing that data to a Writer with a default buffer size of one kilobyte (1,024 chars).
      static void streamToStream​(java.io.Reader in, java.io.Writer out, int bufferSize)
      Convenience method for reading data from a Reader and then immediately writing that data to a Writer.
      • Methods inherited from class java.lang.Object

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

      • StreamUtils

        public StreamUtils()
    • Method Detail

      • streamToStream

        public static void streamToStream​(java.io.Reader in,
                                          java.io.Writer out)
                                   throws java.io.IOException
        Convenience method for reading data from a Reader and then immediately writing that data to a Writer with a default buffer size of one kilobyte (1,024 chars).
        Parameters:
        in - a data source
        out - a data sink
        Throws:
        java.io.IOException - if any.
      • streamToStream

        public static void streamToStream​(java.io.Reader in,
                                          java.io.Writer out,
                                          int bufferSize)
                                   throws java.io.IOException
        Convenience method for reading data from a Reader and then immediately writing that data to a Writer.
        Parameters:
        in - a data source
        out - a data sink
        bufferSize - the size of the char buffer to use for each read/write
        Throws:
        java.io.IOException - if any.
      • streamToStream

        public static void streamToStream​(java.io.InputStream in,
                                          java.io.OutputStream out)
                                   throws java.io.IOException
        Convenience method for reading data from an InputStream and then immediately writing that data to an OutputStream with a default buffer size of one kilobyte (1,024 bytes).
        Parameters:
        in - a data source
        out - a data sink
        Throws:
        java.io.IOException - if any.
      • streamToStream

        public static void streamToStream​(java.io.InputStream in,
                                          java.io.OutputStream out,
                                          int bufferSize)
                                   throws java.io.IOException
        Convenience method for reading data from an InputStream and then immediately writing that data to an OutputStream.
        Parameters:
        in - a data source
        out - a data sink
        bufferSize - the size of the byte buffer to use for each read/write
        Throws:
        java.io.IOException - if any.