protected void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
ServletInputStream ToUserName = request.getInputStream();
final int BUFFER_SIZE = 8 * 1024;
byte[] buffer = new byte[BUFFER_SIZE];
int length = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
do {
length = ToUserName.read(buffer);
if (length > 0) {
baos.write(buffer, 0, length);
}
} while (length * 2 == BUFFER_SIZE);
byte[] ba = baos.toByteArray();
String body = new String(ba, "utf-8");
System.out.println("body::::" + body);
}
throws ServletException, IOException {
ServletInputStream ToUserName = request.getInputStream();
final int BUFFER_SIZE = 8 * 1024;
byte[] buffer = new byte[BUFFER_SIZE];
int length = 0;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
do {
length = ToUserName.read(buffer);
if (length > 0) {
baos.write(buffer, 0, length);
}
} while (length * 2 == BUFFER_SIZE);
byte[] ba = baos.toByteArray();
String body = new String(ba, "utf-8");
System.out.println("body::::" + body);
}