从request中读数据流

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++;
}

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