http://sagewsg.iteye.com/blog/1717923

byte[] bytes = new byte[1024 * 1024];
InputStream is;
try {
is = request.getInputStream();
int nRead = 1;
int nTotalRead = 0;
while (nRead > 0) {
nRead = is.read(bytes, nTotalRead, bytes.length - nTotalRead);
if (nRead > 0)
nTotalRead = nTotalRead + nRead;
}
String str = new String(bytes, 0, nTotalRead, "utf-8");
System.out.println("Str:" + str);
res = str;
is.close();
is = null;
} catch (IOException e) {
e.printStackTrace();
}

最新文章

  1. final修饰的变量是引用不能改变,还是引用的对象不能改变???
  2. ASP.NET的SEO--- Global.asax和HttpModule中的RewritePath()方法
  3. UVaLive 7500 Boxes and Balls (数学)
  4. SATA SAS SSD 硬盘介绍和评测
  5. struts2简介
  6. html = data.decode('gbk').encode('utf-8')
  7. spring 注解配置
  8. Eclipse知识
  9. 201521123118《java程序设计》第一周学习总结
  10. C#中结构体定义并转换字节数组
  11. <转>LOG日志级别
  12. Sublime Text 2激活、插件包安装、以及快捷键
  13. Linux上程序调试的基石(2)--GDB
  14. SpringBoot+Shiro+Redis共享Session入门小栗子
  15. Vux使用经验
  16. Python爬虫——你们要的王者荣耀高清图
  17. Centos7 安装PHP7版本及php-fpm,redis ,php-redis,hiredis,swoole 扩展安装
  18. CSS知识点集锦
  19. close Spark Streaming gratefully
  20. ZOJ2482 IP Address 2017-04-18 23:11 44人阅读 评论(0) 收藏

热门文章

  1. 吝啬的国度 ---用vector 来构图
  2. [转]我是蒟蒻,但我有我的OI信仰
  3. UNIX环境高级编程--7
  4. [转]linux下ulimit命令详解
  5. Hadoop Hive概念学习系列之hive里的用户定义函数UDF(十七)
  6. 一篇文章告诉你如何使用EF CodeFirst做增删改查
  7. JS高级——arguments
  8. C语言保留字
  9. hdu,1028,整数拆分的理解
  10. Android控件的继承关系