private void testBase64EmptyInputStream(final int chuckSize) throws Exception { final byte[] emptyEncoded = new byte[0]; final byte[] emptyDecoded = new byte[0]; testByteByByte(emptyEncoded, emptyDecoded, chuckSize, CRLF); testByChunk(emptyEncoded, emptyDecoded, chuckSize, CRLF); }
/** * Tests the Base64InputStream implementation against empty input. * * @throws Exception * for some failure scenarios. */ @Test public void testBase64EmptyInputStreamMimeChuckSize() throws Exception { testBase64EmptyInputStream(BaseNCodec.MIME_CHUNK_SIZE); }
testByteByByte(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); testByteByByte(encoded, decoded, BaseNCodec.MIME_CHUNK_SIZE, CRLF); testByteByByte(encoded, decoded, BaseNCodec.PEM_CHUNK_SIZE, LF); encoded = StringUtils.getBytesUtf8(singleLine); decoded = Base64TestData.DECODED; testByteByByte(encoded, decoded, 0, LF); encoded = randomData[1]; decoded = randomData[0]; testByteByByte(encoded, decoded, 0, LF);
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);
/** * Tests the Base64InputStream implementation against empty input. * * @throws Exception * for some failure scenarios. */ @Test public void testBase64EmptyInputStreamPemChuckSize() throws Exception { testBase64EmptyInputStream(BaseNCodec.PEM_CHUNK_SIZE); }