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 SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier 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.IoUtilcloseSilently, fileAsByteArray, fileAsStream, fileAsStream, fileAsString, fileAsString, getClasspathFile, getClasspathFile, inputStreamAsByteArray, inputStreamAsString, readerAsString, stringAsInputStream
- 
Field Details- 
ENCODING_CHARSET
 
- 
- 
Constructor Details- 
SpinIoUtilpublic SpinIoUtil()
 
- 
- 
Method Details- 
convertOutputStreamToInputStreamConverts aOutputStreamto anInputStreamby coping the data directly. WARNING: Do not use for large data (>100MB). Only for testing purpose.- Parameters:
- outputStream- the- OutputStreamto convert
- Returns:
- the resulting InputStream
 
- 
getStringFromInputStreamConvert anInputStreamto aString- Parameters:
- inputStream- the- InputStreamto convert
- Returns:
- the resulting String
- Throws:
- IOException
 
- 
getStringFromInputStreampublic static String getStringFromInputStream(InputStream inputStream, boolean trim) throws IOException Convert anInputStreamto aString- Parameters:
- inputStream- the- InputStreamto convert
- trim- trigger if whitespaces are trimmed in the output
- Returns:
- the resulting String
- Throws:
- IOException
 
- 
getStringFromReader- Parameters:
- reader- the- Readerto convert
- Returns:
- the resulting String
- Throws:
- IOException
 
- 
getStringFromReader- Parameters:
- reader- the- Readerto convert
- trim- trigger if whitespaces are trimmed in the output
- Returns:
- the resulting String
- Throws:
- IOException
 
- 
classpathResourceAsReader
- 
stringAsReader
 
-