首页 > 其他 > 详细

After reading a picture than out a picture

时间:2016-05-13 11:09:17      阅读:111      评论:0      收藏:0      [点我收藏+]
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
      //设置响应文本类型
        response.setContentType("image/jpeg");
        //获取输出流
        InputStream in=this.getClass().getClassLoader().getResourceAsStream("girl.jpg");
        //在读写操作前先获得数据流的总长
        int len= 0;
        while (len==0) {
        len=in.available();             
        }
        byte[] buffer=new byte[len];        
        in.read(buffer);
    }
  After reading a picture than out a picture.

After reading a picture than out a picture

原文:http://www.cnblogs.com/CandiceW/p/5486372.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!