码迷,mamicode.com
首页 > 其他好文 > 详细

从request中读数据流

时间:2015-02-11 20:35:25      阅读:176      评论:0      收藏:0      [点我收藏+]

标签:

ServletInputStream servletInputStream = reqeust.getInputStream();

int len=0;
int size=reqeust.getContentLength();

byte[] read =new byte[size];
byte[] inb =new byte[size];

int readLea=0;


while(len<size){
readLea=servletInputStream.read(read);
for(int i=0;i<readLea;i++){
inb[len+i]=read[i];
}

len++;
}

从request中读数据流

标签:

原文地址:http://www.cnblogs.com/wangkeai/p/4286869.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!