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
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ReaderclasspathResourceAsReader(String fileName) static InputStreamconvertOutputStreamToInputStream(OutputStream outputStream) Converts aOutputStreamto anInputStreamby coping the data directly.static StringgetStringFromInputStream(InputStream inputStream) Convert anInputStreamto aStringstatic StringgetStringFromInputStream(InputStream inputStream, boolean trim) Convert anInputStreamto aStringstatic StringgetStringFromReader(Reader reader) static StringgetStringFromReader(Reader reader, boolean trim) static ReaderstringAsReader(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 aOutputStreamto anInputStreamby coping the data directly. WARNING: Do not use for large data (>100MB). Only for testing purpose.- Parameters:
outputStream- theOutputStreamto convert- Returns:
- the resulting
InputStream
-
getStringFromInputStream
Convert anInputStreamto aString- Parameters:
inputStream- theInputStreamto convert- Returns:
- the resulting
String - Throws:
IOException
-
getStringFromInputStream
public static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException Convert anInputStreamto aString- Parameters:
inputStream- theInputStreamto converttrim- trigger if whitespaces are trimmed in the output- Returns:
- the resulting
String - Throws:
IOException
-
getStringFromReader
- Parameters:
reader- theReaderto convert- Returns:
- the resulting
String - Throws:
IOException
-
getStringFromReader
- Parameters:
reader- theReaderto converttrim- trigger if whitespaces are trimmed in the output- Returns:
- the resulting
String - Throws:
IOException
-
classpathResourceAsReader
-
stringAsReader
-