public class IoUtils extends Object
| Constructor and Description |
|---|
IoUtils() |
| Modifier and Type | Method and Description |
|---|---|
static int |
copyAllBytes(InputStream in,
OutputStream out)
Copies all available data from in to out without closing any stream.
|
static byte[] |
getDigest(InputStream in,
String digestAlgo) |
static String |
getMd5(InputStream in) |
static String |
getSha1(InputStream in) |
static byte[] |
readAllBytes(InputStream in) |
static byte[] |
readAllBytesAndClose(InputStream in) |
static String |
readAllChars(Reader reader) |
static String |
readAllCharsAndClose(Reader reader) |
static void |
safeClose(InputStream in)
Closes the given stream inside a try/catch.
|
static void |
safeClose(OutputStream out)
Closes the given stream inside a try/catch.
|
static void |
safeClose(Reader in)
Closes the given stream inside a try/catch.
|
static void |
safeClose(Writer out)
Closes the given stream inside a try/catch.
|
static void |
updateChecksum(InputStream in,
Checksum checksum) |
static void |
writeAllCharsAndClose(Writer writer,
CharSequence text) |
public static byte[] readAllBytes(InputStream in) throws IOException
IOExceptionpublic static byte[] readAllBytesAndClose(InputStream in) throws IOException
IOExceptionpublic static String readAllChars(Reader reader) throws IOException
IOExceptionpublic static String readAllCharsAndClose(Reader reader) throws IOException
IOExceptionpublic static void writeAllCharsAndClose(Writer writer, CharSequence text) throws IOException
IOExceptionpublic static void updateChecksum(InputStream in, Checksum checksum) throws IOException
IOExceptionpublic static String getMd5(InputStream in) throws IOException
IOExceptionpublic static String getSha1(InputStream in) throws IOException
IOExceptionpublic static byte[] getDigest(InputStream in, String digestAlgo) throws IOException
IOExceptionpublic static int copyAllBytes(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static void safeClose(InputStream in)
public static void safeClose(OutputStream out)
public static void safeClose(Reader in)
public static void safeClose(Writer out)
Copyright © 2016. All rights reserved.