Uploaded image for project: 'Commons Codec'
  1. Commons Codec
  2. CODEC-99

Base64.encodeBase64String() shouldn't chunk

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.4
    • Fix Version/s: 1.5
    • Labels:
      None

      Description

      Base64.encodeBase64String() shouldn't chunk.

      Change this:

      public static String encodeBase64String(byte[] binaryData) {
          return StringUtils.newStringUtf8(encodeBase64(binaryData, true));
      }
      

      To this:

      public static String encodeBase64String(byte[] binaryData) {
          return StringUtils.newStringUtf8(encodeBase64(binaryData, false));
      }
      

      This will fix the following tests ggregory added a few minutes ago:

      //assertEquals("Zg==", Base64.encodeBase64String(StringUtils.getBytesUtf8("f")));
      //assertEquals("Zm8=", Base64.encodeBase64String(StringUtils.getBytesUtf8("fo")));
      //assertEquals("Zm9v", Base64.encodeBase64String(StringUtils.getBytesUtf8("foo")));
      //assertEquals("Zm9vYg==", Base64.encodeBase64String(StringUtils.getBytesUtf8("foob")));
      //assertEquals("Zm9vYmE=", Base64.encodeBase64String(StringUtils.getBytesUtf8("fooba")));
      //assertEquals("Zm9vYmFy", Base64.encodeBase64String(StringUtils.getBytesUtf8("foobar")));

        Attachments

        1. codec-99-tests.patch
          3 kB
          Julius Davies
        2. codec-99-test-fixes.patch
          2 kB
          Julius Davies
        3. codec-99-javadoc.patch
          1 kB
          Julius Davies
        4. codec-99.patch
          0.6 kB
          Julius Davies

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              juliusdavies Julius Davies
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: