code: public static byte[] decode(byte[] bytes) {
      ByteArrayInputStream in = new ByteArrayInputStream(bytes);
      // calculate the length of the resulting output.
      // in general it will be at most 3/4 the size of the input
      // but the input length must be divisible by four.
      // If it isn't the next largest size that is divisible
      // by four is used.
      int mod;
      int length = bytes.length;
      if ((mod = length % 4) != 0) {
        length += 4 - mod;
      }
      length = length * 3 / 4;
      ByteArrayOutputStream out = new ByteArrayOutputStream(length);
      try {
        decode(in, out, false);
      } catch (IOException x) {
        // This can't happen.
        // The input and output streams were constructed
        // on memory structures that don't actually use IO.
        throw new RuntimeException(x);
      }
      return out.toByteArray();
    }
docs: Decode Base64 encoded bytes. Characters that are not part of the Base64 alphabet are ignored in
  the input.
  
  @param bytes The data to decode.
  @return Decoded bytes.
  @since ostermillerutils 1.00.00