You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "Ephraim Khantsis (JIRA)" <ji...@apache.org> on 2010/06/14 17:02:15 UTC

[jira] Closed: (CODEC-102) Base64OutputStream can miss last byte

     [ 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.