类 IOUtils


  • public class IOUtils
    extends Object
    Miscellaneous io utility methods. Mainly for internal use within the framework.
    从以下版本开始:
    2.0.7
    作者:
    william.liangf
    • 方法详细资料

      • write

        public static long write​(InputStream is,
                                 OutputStream os,
                                 int bufferSize)
                          throws IOException
        write.
        参数:
        is - InputStream instance.
        os - OutputStream instance.
        bufferSize - buffer size.
        返回:
        count.
        抛出:
        IOException - If an I/O error occurs
      • write

        public static long write​(InputStream input,
                                 OutputStream output,
                                 byte[] buffer)
                          throws IOException
        write.
        参数:
        input - InputStream instance.
        output - OutputStream instance.
        buffer - buffer byte array
        返回:
        count.
        抛出:
        IOException - If an I/O error occurs
      • read

        public static String read​(Reader reader)
                           throws IOException
        read string.
        参数:
        reader - Reader instance.
        返回:
        String.
        抛出:
        IOException - If an I/O error occurs
      • write

        public static long write​(Writer writer,
                                 String string)
                          throws IOException
        write string.
        参数:
        writer - Writer instance.
        string - String.
        抛出:
        IOException - If an I/O error occurs
      • write

        public static long write​(Reader reader,
                                 Writer writer)
                          throws IOException
        write.
        参数:
        reader - Reader.
        writer - Writer.
        返回:
        count.
        抛出:
        IOException - If an I/O error occurs
      • write

        public static long write​(Reader reader,
                                 Writer writer,
                                 int bufferSize)
                          throws IOException
        write.
        参数:
        reader - Reader.
        writer - Writer.
        bufferSize - buffer size.
        返回:
        count.
        抛出:
        IOException - If an I/O error occurs
      • readLines

        public static String[] readLines​(File file)
                                  throws IOException
        read lines.
        参数:
        file - file.
        返回:
        lines.
        抛出:
        IOException - If an I/O error occurs
      • writeLines

        public static void writeLines​(OutputStream os,
                                      String[] lines)
                               throws IOException
        write lines.
        参数:
        os - output stream.
        lines - lines.
        抛出:
        IOException - If an I/O error occurs
      • writeLines

        public static void writeLines​(File file,
                                      String[] lines)
                               throws IOException
        write lines.
        参数:
        file - file.
        lines - lines.
        抛出:
        IOException - If an I/O error occurs
      • appendLines

        public static void appendLines​(File file,
                                       String[] lines)
                                throws IOException
        append lines.
        参数:
        file - file.
        lines - lines.
        抛出:
        IOException - If an I/O error occurs