Serializable
, Comparable<IoUtils>
public enum IoUtils extends Enum<IoUtils>
Modifier and Type | Method | Description |
---|---|---|
static void |
closeQuietly(AutoCloseable is,
org.apache.commons.logging.Log log) |
Closes the given Closeable quietly.
|
static long |
copy(InputStream in,
OutputStream out) |
Copies all bytes from the given input stream to the given output stream.
|
static void |
drainInputStream(InputStream in) |
Read all remaining data in the stream.
|
static byte[] |
toByteArray(InputStream is) |
Reads and returns the rest of the given input stream as a byte array.
|
static String |
toString(InputStream is) |
Reads and returns the rest of the given input stream as a string.
|
static IoUtils |
valueOf(String name) |
Returns the enum constant of this type with the specified name.
|
static IoUtils[] |
values() |
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static IoUtils[] values()
for (IoUtils c : IoUtils.values()) System.out.println(c);
public static IoUtils valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static byte[] toByteArray(InputStream is) throws IOException
IOException
public static String toString(InputStream is) throws IOException
IOException
public static void closeQuietly(AutoCloseable is, org.apache.commons.logging.Log log)
is
- the given closeablelog
- logger used to log any failure should the close failpublic static long copy(InputStream in, OutputStream out) throws IOException
IOException
- if there is any IO exception during read or write.public static void drainInputStream(InputStream in)
in
- InputStream to read.Copyright © 2017 Amazon Web Services, Inc. All Rights Reserved.