public final class IOUtils
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
fromAsset(android.content.Context context,
java.lang.String assetName)
Returns a string from a asset file
|
static java.lang.String |
fromRaw(android.content.Context context,
int resId)
Returns a string from a raw file
|
static java.lang.String |
readAllStream(java.io.InputStream is,
java.lang.String charset)
Returns a string that represent the content of a stream
|
static byte[] |
toByteArray(java.io.InputStream is)
Returns a byte array that represent the content of the stream
|
public static java.lang.String readAllStream(java.io.InputStream is, java.lang.String charset) throws java.io.IOException
is
- the input streamcharset
- the output chatsetjava.io.IOException
- if file is not foundpublic static byte[] toByteArray(java.io.InputStream is) throws java.io.IOException
is
- the input streamjava.io.IOException
- if file is not foundpublic static java.lang.String fromRaw(android.content.Context context, int resId)
context
- the Android contextresId
- the resource idpublic static java.lang.String fromAsset(android.content.Context context, java.lang.String assetName) throws android.content.res.Resources.NotFoundException
context
- the Android contextassetName
- the asset fileandroid.content.res.Resources.NotFoundException
- if file not found