private void testBase64EmptyOutputStream(final int chunkSize) throws Exception { final byte[] emptyEncoded = new byte[0]; final byte[] emptyDecoded = new byte[0]; testByteByByte(emptyEncoded, emptyDecoded, chunkSize, CRLF); testByChunk(emptyEncoded, emptyDecoded, chunkSize, CRLF); }
/** * Test the Base64OutputStream implementation against empty input. * * @throws Exception * for some failure scenarios. */ @Test public void testBase64EmptyOutputStreamMimeChunkSize() throws Exception { testBase64EmptyOutputStream(BaseNCodec.MIME_CHUNK_SIZE); }
testByChunk(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); testByChunk(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); testByChunk(encoded, decoded, BaseNCodec.PEM_CHUNK_SIZE, LF); encoded = StringUtils.getBytesUtf8(singleLine); decoded = Base64TestData.DECODED; testByChunk(encoded, decoded, 0, LF); encoded = randomData[1]; decoded = randomData[0]; testByChunk(encoded, decoded, 0, LF);
testByteByByte(encoded, decoded, 76, CRLF); testByteByByte(encoded, decoded, 76, CRLF); testByteByByte(encoded, decoded, 64, LF); encoded = StringUtils.getBytesUtf8(singleLine); decoded = Base64TestData.DECODED; testByteByByte(encoded, decoded, 0, LF); encoded = randomData[1]; decoded = randomData[0]; testByteByByte(encoded, decoded, 0, LF);
/** * Test the Base64OutputStream implementation against empty input. * * @throws Exception * for some failure scenarios. */ @Test public void testBase64EmptyOutputStreamPemChunkSize() throws Exception { testBase64EmptyOutputStream(BaseNCodec.PEM_CHUNK_SIZE); }