public class StreamUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static java.lang.String[] |
base64(java.io.InputStream in)
Base64 encode the InputStream and calculate MD5 digest
|
static void |
copy(byte[] in,
java.io.OutputStream out)
Copy the contents of the given byte array to the given OutputStream.
|
static int |
copy(java.io.InputStream in,
java.io.OutputStream out)
Copy the contents of the given InputStream to the given OutputStream.
|
static void |
copy(java.lang.String in,
java.nio.charset.Charset charset,
java.io.OutputStream out)
Copy the contents of the given String to the given output OutputStream.
|
static byte[] |
copyToByteArray(java.io.InputStream in)
Copy the contents of the given InputStream into a new byte array.
|
static java.lang.String |
copyToString(java.io.InputStream in,
java.nio.charset.Charset charset)
Copy the contents of the given InputStream into a String.
|
static java.io.InputStream |
loadResource(java.lang.String name) |
public static java.io.InputStream loadResource(java.lang.String name)
public static java.lang.String[] base64(java.io.InputStream in)
in - InputStream to be encoded.public static byte[] copyToByteArray(java.io.InputStream in)
in - the stream to copy frompublic static java.lang.String copyToString(java.io.InputStream in,
java.nio.charset.Charset charset)
in - the InputStream to copy fromcharset - charset to usepublic static void copy(byte[] in,
java.io.OutputStream out)
in - the byte array to copy fromout - the OutputStream to copy topublic static void copy(java.lang.String in,
java.nio.charset.Charset charset,
java.io.OutputStream out)
in - the String to copy fromcharset - the Charsetout - the OutputStream to copy topublic static int copy(java.io.InputStream in,
java.io.OutputStream out)
in - the InputStream to copy fromout - the OutputStream to copy to