`

org.apache.commons.io.CopyUtils

阅读更多
该提供复制操作:
    都是静态函数,没啥亮点
    public static int copy(
            Reader input,
            Writer output)
                throws IOException {
        char[] buffer = new char[DEFAULT_BUFFER_SIZE];
        int count = 0;
        int n = 0;
        while (-1 != (n = input.read(buffer))) {
            output.write(buffer, 0, n);
            count += n;
        }
        return count;
    }

据说可以生成word文件~ JSP的
contentType="application/msword;charset=utf-8"
response.setHeader("Content-disposition",
			"attachment; filename=MyCourse.doc");
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics