in src/main/java/org/apache/sling/servlethelpers/MockSlingHttpServletRequest.java [620:649]
public ServletInputStream getInputStream() {
if (getReaderCalled) {
throw new IllegalStateException();
}
getInputStreamCalled = true;
return new ServletInputStream() {
private final InputStream is =
content == null ? new ByteArrayInputStream(new byte[0]) : new ByteArrayInputStream(content);
@Override
public int read() throws IOException {
return is.read();
}
@Override
public boolean isReady() {
return true;
}
@Override
public boolean isFinished() {
throw new UnsupportedOperationException();
}
@Override
public void setReadListener(ReadListener readListener) {
throw new UnsupportedOperationException();
}
};
}