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();
inputstream与其他格式的转换,布布扣,bubuko.com
时间: 2024-10-04 00:04:23