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] Closed: (CODEC-102) Base64OutputStream can miss last byte
Date Mon, 14 Jun 2010 15:02:15 GMT

     [ https://issues.apache.org/jira/browse/CODEC-102?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Ephraim Khantsis closed CODEC-102.
----------------------------------

    Resolution: Invalid

i noticed Base64OutputStream#close calls it, so let it slip

> 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
>            Reporter: Ephraim Khantsis
>   Original Estimate: 0.02h
>  Remaining Estimate: 0.02h
>
> 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