|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.theappguys.winzigsql.ResourceUtils
public class ResourceUtils
Util methods to read raw assets and resources
| Field Summary | |
|---|---|
static int |
BYTE_BUFFER_SIZE
|
static int |
CHAR_BUFFER_SIZE
|
static Charset |
UTF_8
|
| Method Summary | |
|---|---|
static void |
copy(InputStream in,
OutputStream out)
|
static void |
copy(Reader in,
Writer out)
|
static String |
readAssetAsString(android.content.Context ctx,
String name)
Attempts to read the asset with the given name as a utf-8 string. |
static String |
readRawResourceAsString(android.content.Context ctx,
int id)
Attempts to read the resource with the given id as a utf-8 string. |
static String |
readString(Reader in)
Reads the contents from the given reader. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final Charset UTF_8
public static final int CHAR_BUFFER_SIZE
public static final int BYTE_BUFFER_SIZE
| Method Detail |
|---|
public static String readRawResourceAsString(android.content.Context ctx,
int id)
throws IOException
IOException - reading the resource failed (most likely the
resource does not exist or cannot be read as a raw resource)
public static String readAssetAsString(android.content.Context ctx,
String name)
throws IOException
IOException - reading the asset failed (most likely the given name
was wrong)
public static String readString(Reader in)
throws IOException
in - reader to read from, not null
IOException - reading failed
public static void copy(Reader in,
Writer out)
throws IOException
IOException
public static void copy(InputStream in,
OutputStream out)
throws IOException
IOException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||