Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public String getInputString(HttpServletRequest req) {
- String receivedString = "";
- int len = req.getContentLength();
- byte[] input = new byte[len];
- try {
- ServletInputStream sin = req.getInputStream();
- int c = 0;
- int count = 0;
- while ((c = sin.read(input, count, (input.length - count))) > 0) {
- count += 1;
- }
- sin.close();
- } catch (IOException e) {
- }
- receivedString = new String(input);
- return receivedString;
- }
Advertisement
Add Comment
Please, Sign In to add comment