public class Utility extends Object
| Constructor and Description |
|---|
Utility() |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Annotation> |
findField(Class<?> type,
Class<T> annotationClass) |
static byte[] |
getBytesFromFile(String filePath) |
static String |
getStringFromFile(String filePath) |
static String |
getStringFromFile(String filePath,
String encoding) |
static String |
read(InputStreamReader inputStreamReader) |
static String |
read(InputStream inputStream,
String encoding) |
static boolean |
saveStringToFile(String filePath,
String content,
boolean isOverwrite) |
public static <T extends Annotation> Field findField(Class<?> type, Class<T> annotationClass) throws Exception
Exceptionpublic static String getStringFromFile(String filePath) throws IOException
IOExceptionpublic static String getStringFromFile(String filePath, String encoding) throws IOException
IOExceptionpublic static boolean saveStringToFile(String filePath, String content, boolean isOverwrite)
public static byte[] getBytesFromFile(String filePath) throws FileNotFoundException
FileNotFoundExceptionpublic static String read(InputStreamReader inputStreamReader) throws IOException
IOExceptionpublic static String read(InputStream inputStream, String encoding) throws IOException
IOExceptionCopyright © 2015. All rights reserved.