@Test
public void test3() throws Exception {
   final int maxDataBlockLen = 512;
   sun.misc.BASE64Encoder sunEncoder = new sun.misc.BASE64Encoder();
   sun.misc.BASE64Decoder sunDecoder = new sun.misc.BASE64Decoder();
   Random rnd = new Random(0x39ac7d6e);
   for (int i=0; i<10000; i++) {
      int len = rnd.nextInt(maxDataBlockLen+1);
      byte[] b0 = new byte[len];
      rnd.nextBytes(b0);
      String e1 = new String(Base64Coder.encodeLines(b0));
      String e2 = sunEncoder.encodeBuffer(b0);
      assertEquals (e2, e1);
      byte[] b1 = Base64Coder.decodeLines(e1);
      byte[] b2 = sunDecoder.decodeBuffer(e2);
      assertArrayEquals (b0, b1);
      assertArrayEquals (b0, b2); }}