* Otherwise, process it as UTF-8 bytes and return the equivalent String.
*/
private static String slurpUtf8Part(HttpServletRequest request, HttpServletResponse response, String name, int maxLength)
throws IOException, ServletException
{
Part part = request.getPart(name);
if (part == null) {
response.sendError(400, "Form field " + jq(name) + " is missing");
return null;
}
byte[] bytes = new byte[maxLength];
InputStream in = part.getInputStream();
int bytesRead = in.read(bytes);
String s = new String(bytes, 0, bytesRead, UTF8);
if (in.read() != -1) {
response.sendError(400, "Field " + jq(name) + " is too long (the limit is " + maxLength + " bytes): " + jq(s));
return null;