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

Base64InputStream#read(byte[]) incorrectly returns 0 at end of any stream which is multiple of 3 bytes long

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.4
    • 1.5
    • None
    • WinXP, JDK 1.6.0_14

    Description

      Using new InputStreamReader(new Base64InputStream(in, true)) sometimes fails with "java.io.IOException: Underlying input stream returned zero bytes".

      This is been tracked down that Base64InputStream#read(byte[]) incorrectly returns 0 at end of any stream which is multiple of 3 bytes long.

      Attachments

        1. codec-101-fix.patch
          3 kB
          Julius Davies
        2. codec-101-junit.patch
          2 kB
          Julius Davies
        3. codec-101-another-junit.patch
          2 kB
          Julius Davies

        Activity

          People

            juliusdavies Julius Davies
            balusc Bauke Scholtz
            Votes:
            1 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: