/** * Output the body information. */ private static void outputBody(FileWriter fw, LoggingHttpServletRequestWrapper req) throws IOException { // Get the body size int leng = req.getContentLength(); // Do nothing if there is no body if (leng <= 0) return; // Buffer to read byte rbuf[] = new byte[leng]; // Put data InputStream in = req.getInputStream(); if (in.read(rbuf, 0, leng) > 0) { // Output data outputBinary(fw, rbuf); } }
/** * Output the body information. */ private static void outputBody(FileWriter fw, LoggingHttpServletRequestWrapper req) throws IOException { // Get the body size int leng = req.getContentLength(); // Do nothing if there is no body if (leng <= 0) return; // Buffer to read byte rbuf[] = new byte[leng]; // Put data InputStream in = req.getInputStream(); if (in.read(rbuf, 0, leng) > 0) { // Output data outputBinary(fw, rbuf); } }