Restlet reuse InputStream
问题 Consider the next code. Filter: public class InputFilter extends Filter { @Override protected int beforeHandle(Request request, Response response) { int result = CONTINUE; InputStream inputStream = request.getEntity().getStream(); StringWriter writer = new StringWriter(); IOUtils.copy(inputStream, writer, "UTF-8"); String theString = writer.toString(); JsonRepresentation jRep = new JsonRepresentation(theString); String token = jRep.getJsonObject().getString("token"); . . . return result; } }