Example usage for org.apache.wicket.util.io IOUtils contentEquals

List of usage examples for org.apache.wicket.util.io IOUtils contentEquals

Introduction

In this page you can find the example usage for org.apache.wicket.util.io IOUtils contentEquals.

Prototype

public static boolean contentEquals(Reader input1, Reader input2) throws IOException 

Source Link

Document

Compare the contents of two Readers to determine if they are equal or not.

Usage

From source file:org.hippoecm.frontend.plugins.gallery.imageutil.ImageBinaryTest.java

License:Apache License

@Test
public void testStreams() throws Exception {
    ImageBinary binary = createImageBinary(TEST_RGB_JPG, JPEG_MIME_TYPE);
    assertTrue(IOUtils.contentEquals(readImage(TEST_RGB_JPG), binary.getStream()));

    imageNode.setProperty("jcr:data", binary);
    session.save();/*from w  ww .j a v  a2s.co m*/

    Binary savedBinary = imageNode.getProperty("jcr:data").getBinary();
    assertTrue(IOUtils.contentEquals(savedBinary.getStream(), binary.getStream()));
}