Package org.faktorips.productdataservice
Class FileReaderUtil
- java.lang.Object
-
- org.faktorips.productdataservice.FileReaderUtil
-
public class FileReaderUtil extends Object
Utility class to read the content from anURLorInputStream- Author:
- dirmeier
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static byte[]readContent(InputStream stream)Reads the content of theInputStreamto an byte array.static byte[]readContent(URL url)Reads the content of the given url to a byte array.
-
-
-
Method Detail
-
readContent
public static byte[] readContent(URL url) throws IOException
Reads the content of the given url to a byte array.- Parameters:
url- The URL which content should be read- Returns:
- The byte array that covers the url's content
- Throws:
IOException- In case of exceptions while reading from the URL
-
readContent
public static byte[] readContent(InputStream stream) throws IOException
Reads the content of theInputStreamto an byte array. The caller is responsible to close theInputStreamafter calling this method.- Parameters:
stream- The stream to read from- Returns:
- an array of bytes the covers the content of the given
InputStream - Throws:
IOException- in case of an exception while reading the stream
-
-