Base64Codec { public final static byte[] decodeFast(byte[] sArr, int sLen) throws DecodeException { try { return doDecodeFast(sArr, sLen); } catch (RuntimeException e) { throw new DecodeException(e); } }  final static byte[] encodeToByte(byte[] sArr, boolean lineSep); final static byte[] encodeToByte(byte[] sArr, int sOff, int sLen, boolean lineSep); final static byte[] decode(byte[] sArr); final static byte[] decode(byte[] sArr, int sOff, int sLen); final static byte[] decodeFast(byte[] sArr, int sLen);  }
@Test public void testDecodeFast() throws DecodeException { assertArrayEquals(PLAIN, Base64Codec.decodeFast(ENCODED, ENCODED.length)); }
@Test public void testDecodeFastIllegalLeading() throws DecodeException { byte[] leading = "%$%".getBytes(UTF8); byte[] merged = concat(leading, ENCODED); assertArrayEquals(PLAIN, Base64Codec.decodeFast(merged, merged.length)); }
@Test public void testDecodeFastIllegalTrailing() throws DecodeException { byte[] trailing = "%$%".getBytes(UTF8); byte[] merged = concat(ENCODED, trailing); assertArrayEquals(PLAIN, Base64Codec.decodeFast(merged, merged.length)); }
@Test public void testDecodeFastZeroLength() throws DecodeException { assertEquals(0, Base64Codec.decodeFast(new byte[0], 0).length); }
@Test(expected=DecodeException.class) public void testDecodeFastNullWithNonZeroLength() throws DecodeException { Base64Codec.decodeFast(null, 100); }
@Test(expected=DecodeException.class) public void testDecodeFastInvalidLength() throws DecodeException { Base64Codec.decodeFast(ENCODED, ENCODED.length + 1); }