人们有时使用 BufferedReader 来读取帖子数据。
BufferedReader bReader;
String postData = null;
try {
bReader = request.getReader();
char[] buf = new char[1024];
int len;
StringBuilder sBuilder = new StringBuilder();
while ((len = bReader.read(buf)) != -1) {
sBuilder.append(buf, 0, len);
}
postData = sBuilder.toString();
} catch (IOException e) {
bReader = null;
}
我什么时候应该使用它来获取参数,request.getParameter()怎么样?