commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Julius Davies (JIRA)" <>
Subject [jira] Commented: (CODEC-95) Base64: optionally allow strict parsing of base64 strings
Date Sun, 23 Jan 2011 06:25:43 GMT


Julius Davies commented on CODEC-95:

Just call Base64.isArrayByteBase64(byte[] arrayOctet) on your data first!

For very large data sources where streaming is necessary I would be open to an InputStream
decorator (e.g.  Personally I'm against adding this kind of thing
directly into the Base64 code base because we already support too many variations:

    // too many variations!
    public Base64InputStream(InputStream in, boolean doEncode, int lineLength, byte[] lineSeparator)

One thing we could do to make your life easier is introduce a version of "Base64.isBase64()"
that takes a String instead of byte[].  I'll open a ticket for that.

> Base64: optionally allow strict parsing of base64 strings
> ---------------------------------------------------------
>                 Key: CODEC-95
>                 URL:
>             Project: Commons Codec
>          Issue Type: Improvement
>    Affects Versions: 1.4
>            Reporter: Adam Rabung
>            Priority: Minor
>         Attachments:
> Currently, Codec skips base64 characters that are outside of the encode table.  I realize
this is perfectly to spec, but I wonder if other users might appreciate a "strict" mode that
throws an exception when one of these illegal characters are encountered.  For example, I
would love an exception to be thrown here:
> new Base64().decode("!@#$ iHaveIllegalCharsAtBeginningAndEnd %^&"));

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

View raw message