public final class StreamUtil extends Object
Modifier and Type | Method and Description |
---|---|
static void |
CopyBytes(RandomAccessSource source,
long start,
long length,
OutputStream outs) |
static InputStream |
getResourceStream(String key)
Gets the resource's inputstream.
|
static InputStream |
getResourceStream(String key,
ClassLoader loader)
Gets the resource's inputstream
.
|
static byte[] |
inputStreamToArray(InputStream is)
Reads the full content of a stream and returns them in a byte array
|
public static byte[] inputStreamToArray(InputStream is) throws IOException
is
- the stream to readIOException
- if there is a problem reading from the input streampublic static void CopyBytes(RandomAccessSource source, long start, long length, OutputStream outs) throws IOException
IOException
public static InputStream getResourceStream(String key)
key
- the full name of the resourceInputStream
to get the resource or
null
if not foundpublic static InputStream getResourceStream(String key, ClassLoader loader)
key
- the full name of the resourceloader
- the ClassLoader to load the resource or null to try the ones availableInputStream
to get the resource or
null
if not foundCopyright © 2019. All rights reserved.