inputStream,F(xiàn)ormDataContentDisposition
問題描述:使用jersey框架上傳,通過inputstream 不能獲取到輸入流的字節(jié)大小
解決:將輸入流寫入到輸出流中讀取
byte[] buffer =new byte[1024];
ByteArrayOutputStream outSteam =new ByteArrayOutputStream();
int ls = -1;
try {
while ((ls = inputStream.read(buffer)) != -1) {
outSteam.write(buffer,0, ls);
}
outSteam.close();
inputStream.close();
}catch (IOException e) {
e.printStackTrace();
}
int size = outSteam.size();