Package com.mchange.v1.io
Class InputStreamUtils
- java.lang.Object
-
- com.mchange.v1.io.InputStreamUtils
-
public final class InputStreamUtils extends java.lang.Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
attemptClose(java.io.InputStream is)
static void
attemptClose(java.io.InputStream is, MLogger mlogger)
static void
attemptCloseIgnore(java.io.InputStream is)
static boolean
compare(java.io.InputStream is1, java.io.InputStream is2)
static boolean
compare(java.io.InputStream is1, java.io.InputStream is2, long num_bytes)
static byte[]
getBytes(java.io.InputStream is)
static byte[]
getBytes(java.io.InputStream is, int max_len)
static java.lang.String
getContentsAsString(java.io.InputStream is)
static java.lang.String
getContentsAsString(java.io.InputStream is, int max_len)
static java.lang.String
getContentsAsString(java.io.InputStream is, int max_len, java.lang.String enc)
static java.lang.String
getContentsAsString(java.io.InputStream is, java.lang.String enc)
static java.io.InputStream
getEmptyInputStream()
static void
skipFully(java.io.InputStream is, long num_bytes)
-
-
-
Method Detail
-
compare
public static boolean compare(java.io.InputStream is1, java.io.InputStream is2, long num_bytes) throws java.io.IOException
- Throws:
java.io.IOException
-
compare
public static boolean compare(java.io.InputStream is1, java.io.InputStream is2) throws java.io.IOException
- Throws:
java.io.IOException
-
getBytes
public static byte[] getBytes(java.io.InputStream is, int max_len) throws java.io.IOException
- Throws:
java.io.IOException
-
getBytes
public static byte[] getBytes(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
getContentsAsString
public static java.lang.String getContentsAsString(java.io.InputStream is, java.lang.String enc) throws java.io.IOException, java.io.UnsupportedEncodingException
- Throws:
java.io.IOException
java.io.UnsupportedEncodingException
-
getContentsAsString
public static java.lang.String getContentsAsString(java.io.InputStream is) throws java.io.IOException
- Throws:
java.io.IOException
-
getContentsAsString
public static java.lang.String getContentsAsString(java.io.InputStream is, int max_len, java.lang.String enc) throws java.io.IOException, java.io.UnsupportedEncodingException
- Throws:
java.io.IOException
java.io.UnsupportedEncodingException
-
getContentsAsString
public static java.lang.String getContentsAsString(java.io.InputStream is, int max_len) throws java.io.IOException
- Throws:
java.io.IOException
-
getEmptyInputStream
public static java.io.InputStream getEmptyInputStream()
-
attemptClose
public static void attemptClose(java.io.InputStream is, MLogger mlogger)
-
attemptClose
public static void attemptClose(java.io.InputStream is)
-
attemptCloseIgnore
public static void attemptCloseIgnore(java.io.InputStream is)
-
skipFully
public static void skipFully(java.io.InputStream is, long num_bytes) throws java.io.EOFException, java.io.IOException
- Throws:
java.io.EOFException
java.io.IOException
-
-