@Test
public void testXORBinaryManagerWithInputStream() throws Exception {

    XORBinaryManager binaryManager = new XORBinaryManager();
    binaryManager.initialize(new BinaryManagerDescriptor());
    assertEquals(0, countFiles(binaryManager.getStorageDir()));
    Binary binary = binaryManager.getBinary(CONTENT_MD5);
    assertNull(binary);
    // store binary
    byte[] bytes = CONTENT.getBytes("UTF-8");
    binary = binaryManager.getBinary(new ByteArrayInputStream(bytes));
    assertNotNull(binary);
    assertEquals(1, countFiles(binaryManager.getStorageDir()));
    // get binary
    binary = binaryManager.getBinary(CONTENT_MD5);
    assertNull(binary);
    binary = binaryManager.getBinary(XOR_MD5);
    assertNotNull(binary);
    assertEquals(bytes.length, binary.getLength());
    assertEquals(CONTENT, IOUtils.toString(binary.getStream(), "UTF-8"));
}