类 IOUtil
- java.lang.Object
-
- io.itit.itf.okhttp.util.IOUtil
-
public class IOUtil extends Object
- 作者:
- skydu
-
-
构造器概要
构造器 构造器 说明 IOUtil()
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidcloseQuietly(InputStream input)static voidcloseQuietly(OutputStream output)static byte[]compress(byte[] inputs)static longcopy(InputStream input, OutputStream output)copy inputstream data to output streamstatic voidcopy(InputStream input, Writer output)copy input stream to writerstatic intcopy(Reader input, Writer output)copy input reader to output writerstatic voidcopyFile(File sourceFile, File destFile)copy file from source file to dest filestatic voidcopyFile(String sourceURL, String destFilePath, BiConsumer<Long,Long> progress)copy file from source url to destfilestatic longcopyLarge(Reader input, Writer output)static byte[]decompress(byte[] input)static booleandeleteDirectory(File directory)if we use file.delete to delete a none empty directory,delete action will fail,we need to delete all file under this directory first.static StringgetContent(InputStream in)static List<String>getContentList(InputStream inStream)static byte[]gzipCompress(byte[] inputs)static byte[]gzipDecompress(byte[] inputs)static byte[]toByteArray(InputStream input)convert input stream to byte arraystatic StringtoString(InputStream input)convert inputstream to stringstatic voidunzip(File file, File destFolder)
-
-
-
方法详细资料
-
compress
public static byte[] compress(byte[] inputs)
-
decompress
public static byte[] decompress(byte[] input)
-
closeQuietly
public static void closeQuietly(OutputStream output)
-
closeQuietly
public static void closeQuietly(InputStream input)
-
copy
public static long copy(InputStream input, OutputStream output) throws IOException
copy inputstream data to output stream- 抛出:
IOException
-
getContent
public static String getContent(InputStream in) throws IOException
- 参数:
in-- 返回:
- 抛出:
IOException
-
getContentList
public static List<String> getContentList(InputStream inStream) throws IOException
- 抛出:
IOException
-
unzip
public static void unzip(File file, File destFolder) throws IOException
- 抛出:
IOException
-
copyFile
public static void copyFile(File sourceFile, File destFile) throws Exception
copy file from source file to dest file- 抛出:
Exception
-
copyFile
public static void copyFile(String sourceURL, String destFilePath, BiConsumer<Long,Long> progress) throws Exception
copy file from source url to destfile- 抛出:
Exception
-
deleteDirectory
public static boolean deleteDirectory(File directory)
if we use file.delete to delete a none empty directory,delete action will fail,we need to delete all file under this directory first.
-
toByteArray
public static byte[] toByteArray(InputStream input) throws IOException
convert input stream to byte array- 抛出:
IOException
-
toString
public static String toString(InputStream input) throws IOException
convert inputstream to string- 抛出:
IOException
-
copy
public static void copy(InputStream input, Writer output) throws IOException
copy input stream to writer- 抛出:
IOException
-
copy
public static int copy(Reader input, Writer output) throws IOException
copy input reader to output writer- 抛出:
IOException
-
copyLarge
public static long copyLarge(Reader input, Writer output) throws IOException
- 抛出:
IOException
-
-