public class StreamUtils extends Object
Modifier and Type | Method and Description |
---|---|
static void |
closeSilently(Channel channel) |
static long |
closeSilently(InputStream inputStream)
Close silently the InputStream, first consuming any bytes available, ignoring IOException or null object.
|
static void |
consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
This method consume everything (in particular InpuStream) and close the response.
|
static boolean |
contentEquals(InputStream is1,
InputStream is2) |
static long |
copy(InputStream inputStream,
OutputStream outputStream)
Copy InputStream to OutputStream efficiently
InputStream will be closed, but not the OutputStream in order to be compatible with StreamingOutput |
static InputStream |
getRemainingReadOnCloseInputStream(InputStream inputStream)
Build an InputStream over the source one that will consume any left data when closing it.
|
static InputStream |
toInputStream(String source) |
static String |
toString(InputStream inputStream) |
public static final long copy(InputStream inputStream, OutputStream outputStream) throws IOException
inputStream
- outputStream
- IOException
public static final long closeSilently(InputStream inputStream)
inputStream
- public static final InputStream getRemainingReadOnCloseInputStream(InputStream inputStream)
inputStream
- public static final String toString(InputStream inputStream) throws IOException
inputStream
- IOException
public static InputStream toInputStream(String source)
source
- public static boolean contentEquals(InputStream is1, InputStream is2)
is1
- is2
- public static final void consumeAnyEntityAndClose(javax.ws.rs.core.Response response)
response
- public static void closeSilently(Channel channel)
Copyright © 2019 Vitam. All rights reserved.