commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ephraim Khantsis (JIRA)" <j...@apache.org>
Subject [jira] Created: (CODEC-102) Base64OutputStream can miss last byte
Date Mon, 14 Jun 2010 14:12:14 GMT
Base64OutputStream can miss last byte
-------------------------------------

                 Key: CODEC-102
                 URL: https://issues.apache.org/jira/browse/CODEC-102
             Project: Commons Codec
          Issue Type: Bug
    Affects Versions: 1.4
         Environment: Not important
            Reporter: Ephraim Khantsis


Base64OutputStream misuses Base64.encode class. The documentation specifically says to call
call encode with inAvail = -1, in order to signal Base64 that there is no more input, and
it should wrap up the remaining bytes. Base64OutputStream does not do so, and as a result,
last bytes can be missed.

My proposed fix is to add the following to beginning of Base64OutputStream.flush(boolean):
if (doEncode) {
   base64.encode(null, 0, -1);
}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message