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 read
IOException - if there is a problem reading from the input stream
public 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 resource
InputStream to get the resource or null if not found
public static InputStream getResourceStream(String key, ClassLoader loader)
key - the full name of the resource
loader - the ClassLoader to load the resource or null to try the ones available
InputStream to get the resource or null if not found
Copyright © 1998–2021. All rights reserved.