conn.setDoOutput(true); ByteUtil.copy(req.getInputStream(), conn.getOutputStream());
InputStream is = req.getInputStream(); ByteArrayOutputStream baos = null; try { if (size < 0) size = 0; baos = new ByteArrayOutputStream(size); byte[] buffer = new byte[8192]; int num; while ((num = is.read(buffer)) != -1) { baos.write(buffer, 0, num); } return baos.toByteArray(); } finally { if (baos != null) baos.close(); }
	private void copyPostedData(HttpServletRequest req, HttpURLConnection conn) throws IOException {		if (req.getMethod().equals("GET") || req.getContentLength() <= 0) {			return;		}		conn.setDoOutput(true);		ByteUtil.copy(req.getInputStream(), conn.getOutputStream());	}