Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8013902

Base64.getMimeDecoder().decode() does not ignore padding chars

XMLWordPrintable

    • Verified

      import java.util.Base64;

      public class StartsWithPadding {
          public static void main(String[] args) {
              Base64.getMimeDecoder().decode("$=#");
          }
      }

      A following case results to:
      Exception in thread "main" java.lang.IllegalArgumentException: Input byte array has wrong 4-byte ending unit
      at java.util.Base64$Decoder.decode0(Base64.java:1076)
      at java.util.Base64$Decoder.decode(Base64.java:695)
      at java.util.Base64$Decoder.decode(Base64.java:718)
      at StartsWithPadding.main(StartsWithPadding.java:8)


      This issue is reproducible in b87, looks like problem wasn't completely fixed.

            sherman Xueming Shen
            dpochepk Dmitrij Pochepko
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: