public final class Util
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
closeQuietly(java.io.Closeable closeable) |
static void |
deleteContents(java.io.File dir)
Deletes the contents of
dir. |
static int |
getAppVersion(Context context) |
static java.lang.String |
getCacheDir(Context context) |
static java.lang.String |
readFully(java.io.Reader reader) |
static <T> T |
requireNonNull(T object,
java.lang.String message) |
public static final java.nio.charset.Charset US_ASCII
public static final java.nio.charset.Charset UTF_8
public static java.lang.String readFully(java.io.Reader reader)
throws java.io.IOException
java.io.IOExceptionpublic static void deleteContents(java.io.File dir)
throws java.io.IOException
dir. Throws an IOException if any file
could not be deleted, or if dir is not a readable directory.java.io.IOExceptionpublic static void closeQuietly(java.io.Closeable closeable)
public static java.lang.String getCacheDir(Context context)
public static int getAppVersion(Context context)
public static <T> T requireNonNull(T object,
java.lang.String message)