public class StreamHelpers
extends java.lang.Object
Constructor and Description |
---|
StreamHelpers() |
Modifier and Type | Method and Description |
---|---|
static java.io.ByteArrayInputStream |
byteStreamFromFile(java.lang.String fileName)
Creates a java.io.ByteArrayInputStream from a file.
|
static java.io.ByteArrayInputStream |
byteStreamFromInputStream(java.io.InputStream inputStream)
Creates a java.io.ByteArrayInputStream from a java.io.InputStream.
|
static void |
writeByteStreamToFile(java.io.ByteArrayOutputStream csvStream,
java.lang.String outputFileName,
java.lang.Boolean writeUTF8ByteOrderMark)
Creates a file and write the contents of a java.io.ByteArrayOutputStream to the file.
|
public static java.io.ByteArrayInputStream byteStreamFromFile(java.lang.String fileName) throws java.io.IOException
fileName
- the name of the filejava.io.IOException
- if an error occurs while creating a ByteArrayInputStreampublic static java.io.ByteArrayInputStream byteStreamFromInputStream(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- the InputStream to be convertedjava.io.IOException
- if an error occurs while creating a ByteArrayInputStreampublic static void writeByteStreamToFile(java.io.ByteArrayOutputStream csvStream, java.lang.String outputFileName, java.lang.Boolean writeUTF8ByteOrderMark) throws java.lang.Exception
csvStream
- the ByteArrayOutputStream to be written to the file.outputFileName
- the name of the file to be created.writeUTF8ByteOrderMark
- true if the UTF-8 byte order mark should be written to the file; false if notjava.lang.Exception
- if an error occurs while creating a file or writing the stream to the file