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.

相关文章:

  • 2021-07-10
  • 2022-12-23
  • 2022-12-23
  • 2021-09-02
  • 2022-01-30
猜你喜欢
  • 2022-12-23
  • 2021-10-08
  • 2021-11-09
  • 2021-04-20
  • 2021-05-06
  • 2021-05-24
相关资源
相似解决方案