public final class StreamUtil
extends java.lang.Object
| Modifier and Type | Method | Description |
|---|---|---|
static void |
CopyBytes(RandomAccessSource source,
long start,
long length,
java.io.OutputStream outs) |
|
static java.io.InputStream |
getResourceStream(java.lang.String key) |
Gets the resource's inputstream.
|
static java.io.InputStream |
getResourceStream(java.lang.String key,
java.lang.ClassLoader loader) |
Gets the resource's inputstream
.
|
static byte[] |
inputStreamToArray(java.io.InputStream is) |
Reads the full content of a stream and returns them in a byte array
|
public static byte[] inputStreamToArray(java.io.InputStream is)
throws java.io.IOException
is - the stream to readjava.io.IOException - if there is a problem reading from the input streampublic static void CopyBytes(RandomAccessSource source, long start, long length, java.io.OutputStream outs) throws java.io.IOException
java.io.IOExceptionpublic static java.io.InputStream getResourceStream(java.lang.String key)
key - the full name of the resourceInputStream to get the resource or
null if not foundpublic static java.io.InputStream getResourceStream(java.lang.String key,
java.lang.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 © 1998–2018. All rights reserved.