码迷,mamicode.com
首页 > 其他好文 > 详细

After reading a picture than out a picture

时间:2016-05-13 11:09:24      阅读:129      评论: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
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!