Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Testing Extract Servlet Meta data


Level 1

SlingHttpServletResponse.getOutStream is coming as null while running the test case

1 Reply


Level 3



getOutputStream is used for writing the binary content. If I understand your usecase correctly you are trying to read from the servlet response. In this case you can do something like -


ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(response.getOutput());
BufferedImage image =;

and then you can read metadata from the image object.