1、InputStream 转换成InputSource 。

InputStream inputStream = request.getInputStream();
InputSource input = new InputSource(inputStream);

2、InputStream 输出转换成字符串输出。

InputStream inputStream = request.getInputStream();

        StringBuffer   out   =   new   StringBuffer(); 
        byte[]   b   =   new   byte[4096]; 
        for   (int   n;   (n   =   inputStream .read(b))   !=   -1;)  

        { 
                out.append(new   String(b,   0,   n)); 
        } 
        String value = out.toString();

 

 

相关文章:

  • 2022-02-21
  • 2021-07-24
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-11-15
  • 2022-01-28
猜你喜欢
  • 2021-12-05
  • 2022-12-23
  • 2021-10-18
  • 2022-12-23
  • 2022-01-09
  • 2022-01-15
  • 2022-01-05
相关资源
相似解决方案