public class IoUtils
extends java.lang.Object
Constructor and Description |
---|
IoUtils() |
Modifier and Type | Method and Description |
---|---|
static int |
copyAllBytes(java.io.InputStream in,
java.io.OutputStream out)
Copies all available data from in to out without closing any stream.
|
static byte[] |
getDigest(java.io.InputStream in,
java.lang.String digestAlgo) |
static java.lang.String |
getMd5(java.io.InputStream in) |
static java.lang.String |
getSha1(java.io.InputStream in) |
static byte[] |
readAllBytes(java.io.InputStream in) |
static byte[] |
readAllBytesAndClose(java.io.InputStream in) |
static java.lang.String |
readAllChars(java.io.Reader reader) |
static java.lang.String |
readAllCharsAndClose(java.io.Reader reader) |
static void |
safeClose(java.io.Closeable closeable)
Closes the given resource (e.g. stream, reader, writer, etc.) inside a try/catch.
|
static void |
updateChecksum(java.io.InputStream in,
java.util.zip.Checksum checksum) |
static void |
writeAllCharsAndClose(java.io.Writer writer,
java.lang.CharSequence text) |
public static byte[] readAllBytes(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static byte[] readAllBytesAndClose(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.lang.String readAllChars(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static java.lang.String readAllCharsAndClose(java.io.Reader reader) throws java.io.IOException
java.io.IOException
public static void writeAllCharsAndClose(java.io.Writer writer, java.lang.CharSequence text) throws java.io.IOException
java.io.IOException
public static void updateChecksum(java.io.InputStream in, java.util.zip.Checksum checksum) throws java.io.IOException
java.io.IOException
public static java.lang.String getMd5(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static java.lang.String getSha1(java.io.InputStream in) throws java.io.IOException
java.io.IOException
public static byte[] getDigest(java.io.InputStream in, java.lang.String digestAlgo) throws java.io.IOException
java.io.IOException
public static int copyAllBytes(java.io.InputStream in, java.io.OutputStream out) throws java.io.IOException
java.io.IOException
public static void safeClose(java.io.Closeable closeable)
Available under the Apache License, Version 2.0 - Copyright © 2012-2016 greenrobot.org. All Rights Reserved.