@Override
    public void write(final int b) throws IOException {
        throw new IOException(new UnsupportedOperationException());
    }
@Test
    public void testWriteWithChunkSize() throws Exception {
        final CryptoVault vault = this.getVault();
        final ByteArrayOutputStream cipherText = new ByteArrayOutputStream();
        final FileHeader header = vault.getFileHeaderCryptor().create();
        final CryptoOutputStream stream = new CryptoOutputStream(
                new ProxyOutputStream(cipherText), vault.getFileContentCryptor(), header, new RandomNonceGenerator(vault.getNonceSize()), 0);

        final byte[] cleartext = RandomUtils.nextBytes(vault.getFileContentCryptor().cleartextChunkSize());
        stream.write(cleartext, 0, cleartext.length);
        stream.close();

        final byte[] read = new byte[cleartext.length];
        final CryptoInputStream cryptoInputStream = new CryptoInputStream(new ByteArrayInputStream(cipherText.toByteArray()), vault.getFileContentCryptor(), header, 0);
        assertEquals(cleartext.length, cryptoInputStream.read(read));
        cryptoInputStream.close();

        assertArrayEquals(cleartext, read);
    }