@Test
public void encryptedAtRestTest_stream() throws TaskIOException, IOException {

    PDImageXObject result = PageImageWriter.toPDXImageObject(encryptedAtRest(customNonPdfInput("image/large.jpg")));
    assertThat(result.getColorSpace(), is(PDDeviceRGB.INSTANCE));
    assertThat(result.getHeight(), is(3840));
    assertTrue("Decrypted bytes should be used",
            IOUtils.contentEquals(
                    result.getCOSObject().getFilteredStream(),
                    customNonPdfInput("image/large.jpg").getSource()
            )
    );
}