public abstract class FileIOOpt extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
protected static org.slf4j.Logger |
logger |
public static int writeInputStreamToOutputStream(InputStream in, OutputStream out) throws IOException
IOExceptionpublic static int writeInputStreamToFile(InputStream in, File file) throws IOException
IOExceptionpublic static int writeInputStreamToFile(InputStream in, String filePath) throws IOException
IOExceptionpublic static int appendInputStreamToFile(InputStream in, File file) throws IOException
IOExceptionpublic static int appendInputStreamToFile(InputStream in, String filePath) throws IOException
IOExceptionpublic static void writeStringToOutputStream(String strData, OutputStream io) throws IOException
IOExceptionpublic static void writeStringToFile(String strData, File file) throws IOException
IOExceptionpublic static void writeStringToFile(String strData, String fileName) throws IOException
IOExceptionpublic static void appendStringToFile(String strData, File file) throws IOException
IOExceptionpublic static void appendStringToFile(String strData, String fileName) throws IOException
IOExceptionpublic static String readStringFromRead(Reader reader) throws IOException
IOExceptionpublic static byte[] readBytesFromInputStream(InputStream is) throws IOException
is - 输入流IOException - 异常public static byte[] readBytesFromInputStream(InputStream is, int length) throws IOException
is - 输入流length - 最大读取长度IOException - 异常public static byte[] readBytesFromFile(File file, int length) throws IOException
IOExceptionpublic static byte[] readBytesFromFile(File file) throws IOException
IOExceptionpublic static byte[] readBytesFromFile(String filePath, int length) throws IOException
IOExceptionpublic static byte[] readBytesFromFile(String filePath) throws IOException
IOExceptionpublic static String readStringFromInputStream(InputStream is, String charsetName) throws IOException
IOExceptionpublic static String readStringFromInputStream(InputStream is) throws IOException
IOExceptionpublic static String readStringFromFile(File file, String charsetName) throws IOException
IOExceptionpublic static String readStringFromFile(File file) throws IOException
IOExceptionpublic static String readStringFromFile(String fileName, String charsetName) throws IOException
IOExceptionpublic static String readStringFromFile(String fileName) throws IOException
IOExceptionpublic static void writeObjectToFile(Object obj, String fileName) throws IOException
IOExceptionpublic static Object readObjectFromFile(String fileName) throws IOException, ClassNotFoundException
public static void writeObjectAsJsonToFile(Object obj, String fileName) throws IOException
IOExceptionpublic static void writeBytesToFile(byte[] bytes,
String fileName)
throws IOException
IOExceptionpublic static void writeBytesToFile(byte[] bytes,
File file)
throws IOException
IOExceptionpublic static void appendBytesToFile(byte[] bytes,
File file)
throws IOException
IOExceptionpublic static void appendBytesToFile(byte[] bytes,
String fileName)
throws IOException
IOExceptionpublic static <T> T readObjectAsJsonFromFile(String fileName, Class<T> clazz) throws IOException
IOExceptionpublic static InputStream castObjectToInputStream(Object data)
public static void close(Closeable closeable)
closeable - closeableCopyright © 2025 江苏南大先腾信息产业股份有限公司. All rights reserved.