docs: @Pure
  	@SuppressWarnings({"checkstyle:magicnumber", "checkstyle:cyclomaticcomplexity", "checkstyle:npathcomplexity"})
  	public static byte[] decode(char[] in) {
  		int ilen = in.length;
  		if (ilen % 4 != 0) {
  			throw new IllegalArgumentException(Locale.getString("INVALID_STRING_LENGTH")); //$NON-NLS-1$
  		}
  		while (ilen > 0 && in[ilen - 1] == '=') {
  			--ilen;
  		}
  		final int olen = (ilen * 3) / 4;
  		final byte[] out = new byte[olen];
  		int ip = 0;
  		int op = 0;
  		while (ip < ilen) {
  			final int i0 = in[ip++];
  			final int i1 = in[ip++];
  			final int i2 = ip < ilen ? in[ip++] : 'A';
  			final int i3 = ip < ilen ? in[ip++] : 'A';
  			if (i0 > 127 || i1 > 127 || i2 > 127 || i3 > 127) {
  				throw new IllegalArgumentException();
  			}
  			final int b0 = map2[i0];
  			final int b1 = map2[i1];
  			final int b2 = map2[i2];
  			final int b3 = map2[i3];
  			if (b0 < 0 || b1 < 0 || b2 < 0 || b3 < 0) {
  				throw new IllegalArgumentException(Locale.getString("ILLEGAL_CHARACTER")); //$NON-NLS-1$
  			}
  			final int o0 = (b0 << 2) | (b1 >>> 4);
  			final int o1 = ((b1 & 0xf) << 4) | (b2 >>> 2);
  			final int o2 = ((b2 & 3) << 6) | b3;
  			out[op++] = (byte) o0;
  			if (op < olen) {
  				out[op++] = (byte) o1;
  			}
  			if (op < olen) {
  				out[op++] = (byte) o2;
  			}
  		}
  		return out;
  	}