public class SpinIoUtil
extends org.camunda.commons.utils.IoUtil
| Modifier and Type | Field and Description |
|---|---|
static java.nio.charset.Charset |
ENCODING_CHARSET |
| Constructor and Description |
|---|
SpinIoUtil() |
| Modifier and Type | Method and Description |
|---|---|
static java.io.Reader |
classpathResourceAsReader(java.lang.String fileName) |
static java.io.InputStream |
convertOutputStreamToInputStream(java.io.OutputStream outputStream)
Converts a
OutputStream to an InputStream by coping the data directly. |
static java.lang.String |
getStringFromInputStream(java.io.InputStream inputStream)
Convert an
InputStream to a String |
static java.lang.String |
getStringFromInputStream(java.io.InputStream inputStream,
boolean trim)
Convert an
InputStream to a String |
static java.lang.String |
getStringFromReader(java.io.Reader reader)
Convert an
Reader to a String |
static java.lang.String |
getStringFromReader(java.io.Reader reader,
boolean trim)
Convert an
Reader to a String |
static java.io.Reader |
stringAsReader(java.lang.String string) |
public static java.io.InputStream convertOutputStreamToInputStream(java.io.OutputStream outputStream)
OutputStream to an InputStream by coping the data directly.
WARNING: Do not use for large data (>100MB). Only for testing purpose.outputStream - the OutputStream to convertInputStreampublic static java.lang.String getStringFromInputStream(java.io.InputStream inputStream)
throws java.io.IOException
InputStream to a StringinputStream - the InputStream to convertStringjava.io.IOExceptionpublic static java.lang.String getStringFromInputStream(java.io.InputStream inputStream,
boolean trim)
throws java.io.IOException
InputStream to a StringinputStream - the InputStream to converttrim - trigger if whitespaces are trimmed in the outputStringjava.io.IOExceptionpublic static java.lang.String getStringFromReader(java.io.Reader reader)
throws java.io.IOException
Reader to a Stringreader - the Reader to convertStringjava.io.IOExceptionpublic static java.lang.String getStringFromReader(java.io.Reader reader,
boolean trim)
throws java.io.IOException
Reader to a Stringreader - the Reader to converttrim - trigger if whitespaces are trimmed in the outputStringjava.io.IOExceptionpublic static java.io.Reader classpathResourceAsReader(java.lang.String fileName)
public static java.io.Reader stringAsReader(java.lang.String string)
Copyright © 2014–2022 Camunda Services GmbH. All rights reserved.