Class IoUtils
- java.lang.Object
-
- com.alibaba.nacos.client.naming.utils.IoUtils
-
public class IoUtils extends Object
- Author:
- nkorange
-
-
Constructor Summary
Constructors Constructor Description IoUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcleanDirectory(File directory)static longcopy(InputStream input, OutputStream output)static longcopy(Reader input, Writer output)static voidcopyFile(String source, String target)static voiddelete(File fileOrDir)static booleanisGzipStream(byte[] bytes)static List<String>readLines(Reader input)static StringtoString(InputStream input, String encoding)static StringtoString(Reader reader)static byte[]tryDecompress(byte[] raw)
-
-
-
Method Detail
-
toString
public static String toString(InputStream input, String encoding)
-
toString
public static String toString(Reader reader) throws IOException
- Throws:
IOException
-
copy
public static long copy(Reader input, Writer output) throws IOException
- Throws:
IOException
-
copy
public static long copy(InputStream input, OutputStream output) throws IOException
- Throws:
IOException
-
readLines
public static List<String> readLines(Reader input) throws IOException
- Throws:
IOException
-
copyFile
public static void copyFile(String source, String target) throws IOException
- Throws:
IOException
-
delete
public static void delete(File fileOrDir) throws IOException
- Throws:
IOException
-
cleanDirectory
public static void cleanDirectory(File directory) throws IOException
- Throws:
IOException
-
isGzipStream
public static boolean isGzipStream(byte[] bytes)
-
-