* @param response
* @return
*/
protected ByteArrayInputStream getBinaryInputStream(MockHttpServletResponse response) {
try {
MockServletOutputStream os = (MockServletOutputStream) response.getOutputStream();
final Field field = os.getClass().getDeclaredField("buffer");
field.setAccessible(true);
ByteArrayOutputStream bos = (ByteArrayOutputStream) field.get(os);
return new ByteArrayInputStream(bos.toByteArray());
} catch (Exception e) {
throw new RuntimeException("Whoops, did you change the MockRunner version? "