public class Utils {
public static String getTextFromStream(InputStream is){
int len=0;
byte[] b=new byte[1024];
ByteArrayOutputStream baos=new ByteArrayOutputStream();
try {
while((len=is.read(b))!=-1){
baos.write(b,0,len);
}
} catch (IOException e) {
e.printStackTrace();
}
String text=new String(baos.toByteArray());
return text;
}
}
输入流转换成字符串
最新推荐文章于 2023-05-09 14:19:44 发布
1261

被折叠的 条评论
为什么被折叠?



