日期:2014-05-17 浏览次数:20800 次
ServletInputStream sis = request.getInputStream();
String k;
if ((k = s.indexOf("name=\"")) != -1) {
String fieldName = s.substring(k + 6, s.length() - 3);
//sis.readLine(b, 0, b.length);
StringBuilder fieldValue = new StringBuilder(b.length);
while ((a = sis.readLine(b, 0, b.length)) != -1) {
s = new String(b, 0, a -2);
if ((b[0] == 45) && (b[1] == 45) && (b[2] == 45)
&& (b[3] == 45) && (b[4] == 45)) {
break;
} else {
fieldValue.append(s);
}
}
fields.put(fieldName, fieldValue.toString());
}