// 压缩字符串传输
private void pageOutByte(HttpServletResponse response, String buf)
throws ServletException, IOException {
response.setContentType("Content-Type application/x-gzip-compressed");
byte[] bufs=Gzip.gzipByte(new sun.misc.BASE64Encoder().encode(changeCharset(buf,"gb2312").getBytes()));
ServletOutputStream sos = response.getOutputStream();
sos.write(bufs);
sos.close();
}
// 不压缩直接传输
private void pageOut(HttpServletResponse response, String msg) {
response.setContentType("text/html");
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException ex) {
}
out.print(msg);
out.close();
}
private void pageOutByte(HttpServletResponse response, String buf)
throws ServletException, IOException {
response.setContentType("Content-Type application/x-gzip-compressed");
byte[] bufs=Gzip.gzipByte(new sun.misc.BASE64Encoder().encode(changeCharset(buf,"gb2312").getBytes()));
ServletOutputStream sos = response.getOutputStream();
sos.write(bufs);
sos.close();
}
// 不压缩直接传输
private void pageOut(HttpServletResponse response, String msg) {
response.setContentType("text/html");
PrintWriter out = null;
try {
out = response.getWriter();
} catch (IOException ex) {
}
out.print(msg);
out.close();
}