Package org.faktorips.util
Class StreamUtil
java.lang.Object
org.faktorips.util.StreamUtil
A utility class for streams.
-
Method Summary
Modifier and TypeMethodDescriptionstatic final ByteArrayInputStreamcopy(InputStream is) Copies the content of the provided InputStream into a ByteArrayInputStream and closes the provided stream.static final ByteArrayOutputStreamCopies the content of the provided InputStream into a ByteArrayOutputStream and closes the provided stream.
-
Method Details
-
copy
Copies the content of the provided InputStream into a ByteArrayInputStream and closes the provided stream.- Parameters:
is- the InputStream to be copied- Returns:
- the new ByteArrayInputStream with the copied content
- Throws:
IOException- exceptions that occur during reading from and writing to a stream or closing the provided stream are delegated
-
toByteArrayOutputStream
public static final ByteArrayOutputStream toByteArrayOutputStream(InputStream is) throws IOException Copies the content of the provided InputStream into a ByteArrayOutputStream and closes the provided stream.- Parameters:
is- the InputStream to be copied- Returns:
- the new ByteArrayInputStream with the copied content
- Throws:
IOException- exceptions that occur during reading from and writing to a stream or closing the provided stream are delegated
-