Class Streams

java.lang.Object
org.jboss.forge.roaster.Streams

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

    • toString

      public static String toString(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:
      RuntimeException - if a IOException occurs
    • write

      public static void write(InputStream source, 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:
      RuntimeException - if a IOException occurs.