Package org.jboss.forge.roaster
Class Streams
java.lang.Object
org.jboss.forge.roaster.Streams
Various stream utilities.
- Author:
- Lincoln Baxter, III
-
Method Summary
Modifier and TypeMethodDescriptionstatic StringtoString(InputStream stream) Return aStringcontaining the contents of the givenInputStream.static voidwrite(InputStream source, OutputStream destination) Writes the content of the source stream to the destination stream.
-
Method Details
-
toString
Return aStringcontaining the contents of the givenInputStream. The caller is responsible to close the stream.- Parameters:
stream- the stream to read from- Returns:
- the content of the stream
- Throws:
RuntimeException- if aIOExceptionoccurs
-
write
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 fromdestination- the destination stream to write to- Throws:
RuntimeException- if aIOExceptionoccurs.
-