| Modifier and Type | Field and Description |
|---|---|
| private static final boolean | |
| private static final Logger |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static void | |
| public static Optional | Returns: description of the first difference, orOptional#empty() if the contents are
the samefirst input stream input1, InputStream second input stream input2)Return |
| public static ByteArrayInputStream | Returns: A new ByteArrayInputStream instance.The byte buffer. buffer)Creates a new |
| public static String | getStreamWarningMessage(String clientName, String operationNames)
Gets the stream warning message to warn the users about closing the stream |
| public static boolean | isExtraStreamLogsEnabled()
The boolean value indicating if extra logs related to operations that return streams are enabled/disabled. |
| private static boolean | |
| public static InputStream | Returns: limited streaminput stream is, long upper limit of remaining bytes limit)Limit the number of bytes remaining in the input stream to at most this many bytes. |
| public static long | Returns: number of bytes that were skippedstream is, long number of bytes to skip count)Skip the specified number of bytes in the stream. |
| public static byte[] | Returns: byte arrayinput stream inputStream)Convert the input stream to a byte array. |
| public static InputStream | Returns: A new InputStream instance.The file to convert to a stream. file)Convert a File to an InputStream. |
| public static String | Returns: stringinput stream is, Charset charset to use charset)Convert the input stream to a string. |
| isExtraStreamLogsEnabled | back to summary |
|---|---|
| private static final boolean isExtraStreamLogsEnabled | |
| LOG | back to summary |
|---|---|
| private static final Logger LOG | |
| StreamUtils | back to summary |
|---|---|
| private StreamUtils() | |
| closeQuietly | back to summary |
|---|---|
| public static void closeQuietly(InputStream stream) Close a stream without raising an exception.
| |
| contentDiffers | back to summary |
|---|---|
| public static Optional Return
| |
| createByteArrayInputStream | back to summary |
|---|---|
| public static ByteArrayInputStream createByteArrayInputStream(byte[] buffer) Creates a new
| |
| getStreamWarningMessage | back to summary |
|---|---|
| public static String getStreamWarningMessage(String clientName, String operationNames) Gets the stream warning message to warn the users about closing the stream | |
| isExtraStreamLogsEnabled | back to summary |
|---|---|
| public static boolean isExtraStreamLogsEnabled() The boolean value indicating if extra logs related to operations that return streams are enabled/disabled. Disabling this will disable warnings to close the streams, logs about wrapping response stream in an auto-closeble stream. Default is true. | |
| isExtraStreamLogsEnabledViaSystemProperty | back to summary |
|---|---|
| private static boolean isExtraStreamLogsEnabledViaSystemProperty() | |
| limitRemainingStreamLength | back to summary |
|---|---|
| public static InputStream limitRemainingStreamLength(InputStream is, long limit) Limit the number of bytes remaining in the input stream to at most this many bytes. The input stream may reach its end earlier.
| |
| skipBytesInStream | back to summary |
|---|---|
| public static long skipBytesInStream(InputStream is, long count) throws IOException Skip the specified number of bytes in the stream.
| |
| toByteArray | back to summary |
|---|---|
| public static byte[] toByteArray(InputStream inputStream) throws IOException Convert the input stream to a byte array.
| |
| toInputStream | back to summary |
|---|---|
| public static InputStream toInputStream(File file) Convert a File to an InputStream. This uses
| |
| toString | back to summary |
|---|---|
| public static String toString(InputStream is, Charset charset) Convert the input stream to a string.
| |