Class Streams


  • public abstract class Streams
    extends java.lang.Object
    Various stream utilities.
    Author:
    Lincoln Baxter, III
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String toString​(java.io.InputStream stream)
      Return a String containing the contents of the given InputStream.
      static void write​(java.io.InputStream source, java.io.OutputStream destination)
      Writes the content of the source stream to the destination stream.
      • Methods inherited from class java.lang.Object

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

      • toString

        public static java.lang.String toString​(java.io.InputStream stream)
        Return a String containing the contents of the given InputStream. The caller is responsible to close the stream.
        Parameters:
        stream - the stream to read from
        Returns:
        the content of the stream
        Throws:
        java.lang.RuntimeException - if a IOException occurs
      • write

        public static void write​(java.io.InputStream source,
                                 java.io.OutputStream destination)
        Writes the content of the source stream to the destination stream. The caller is responsible to close the streams.
        Parameters:
        source - the source stream to read from
        destination - the destination stream to write to
        Throws:
        java.lang.RuntimeException - if a IOException occurs.