public class IOUtils
extends java.lang.Object
| Constructor and Description |
|---|
IOUtils() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
readAll(java.io.InputStream is)
Read all bytes from a stream.
|
static java.util.Optional<byte[]> |
readResource(java.lang.Class<?> clazz,
java.lang.String path)
Read a resource from the classpath as bytes.
|
static java.util.Optional<byte[]> |
readResource(java.lang.ClassLoader loader,
java.lang.String path)
Read a resource from the classpath as bytes.
|
static java.util.Optional<byte[]> |
readResource(java.lang.String path)
Read a resource from the classpath as bytes.
|
public static java.util.Optional<byte[]> readResource(java.lang.String path)
throws java.io.IOException
path - The path to the resourcejava.io.IOException - If an I/O error occurspublic static java.util.Optional<byte[]> readResource(java.lang.Class<?> clazz,
java.lang.String path)
throws java.io.IOException
clazz - The class to search the resource inpath - The path to the resourcejava.io.IOException - If an I/O error occurspublic static java.util.Optional<byte[]> readResource(java.lang.ClassLoader loader,
java.lang.String path)
throws java.io.IOException
loader - The class loader to search the resource inpath - The path to the resourcejava.io.IOException - If an I/O error occurs@WillNotClose
public static byte[] readAll(java.io.InputStream is)
throws java.io.IOException
is - The InputStream to read fromjava.io.IOException - If an I/O error occurs