Package org.camunda.spin.impl.util
Class SpinIoUtil
java.lang.Object
org.camunda.commons.utils.IoUtil
org.camunda.spin.impl.util.SpinIoUtil
- Author:
- Daniel Meyer
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Reader
classpathResourceAsReader
(String fileName) static InputStream
convertOutputStreamToInputStream
(OutputStream outputStream) Converts aOutputStream
to anInputStream
by coping the data directly.static String
getStringFromInputStream
(InputStream inputStream) Convert anInputStream
to aString
static String
getStringFromInputStream
(InputStream inputStream, boolean trim) Convert anInputStream
to aString
static String
getStringFromReader
(Reader reader) static String
getStringFromReader
(Reader reader, boolean trim) static Reader
stringAsReader
(String string) Methods inherited from class org.camunda.commons.utils.IoUtil
closeSilently, fileAsByteArray, fileAsStream, fileAsStream, fileAsString, fileAsString, getClasspathFile, getClasspathFile, inputStreamAsByteArray, inputStreamAsString, readerAsString, stringAsInputStream
-
Field Details
-
ENCODING_CHARSET
-
-
Constructor Details
-
SpinIoUtil
public SpinIoUtil()
-
-
Method Details
-
convertOutputStreamToInputStream
Converts aOutputStream
to anInputStream
by coping the data directly. WARNING: Do not use for large data (>100MB). Only for testing purpose.- Parameters:
outputStream
- theOutputStream
to convert- Returns:
- the resulting
InputStream
-
getStringFromInputStream
Convert anInputStream
to aString
- Parameters:
inputStream
- theInputStream
to convert- Returns:
- the resulting
String
- Throws:
IOException
-
getStringFromInputStream
public static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException Convert anInputStream
to aString
- Parameters:
inputStream
- theInputStream
to converttrim
- trigger if whitespaces are trimmed in the output- Returns:
- the resulting
String
- Throws:
IOException
-
getStringFromReader
- Parameters:
reader
- theReader
to convert- Returns:
- the resulting
String
- Throws:
IOException
-
getStringFromReader
- Parameters:
reader
- theReader
to converttrim
- trigger if whitespaces are trimmed in the output- Returns:
- the resulting
String
- Throws:
IOException
-
classpathResourceAsReader
-
stringAsReader
-