Using Servlet, I can do the following to process binary stream:
public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
InputStream inputStream = req.getInputStream();
byte[] data = IOUtils.toByteArray(inputStream);
// ...
Result result = process(data);
// ...
ServletOutputStream op = resp.getOutputStream();
result.writeTo(resp.getOutputStream());
}
How I can do this in Wicket? (I have no clue after creating a page extends WebPage class)
I am now using AbstractResourceStreamWriter to implement the solution: