Issue Details (XML | Word | Printable)

Key: CODEC-71
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Sebb
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Commons Codec

Base64.isArrayByteBase64() method is inefficient for large byte arrays

Created: 21/Jun/08 02:11 PM   Updated: 01/Jul/08 04:55 AM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 1.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works Base64.patch 2008-06-21 02:11 PM Sebb 2 kB

Resolution Date: 01/Jul/08 04:55 AM


 Description  « Hide
Base64.isArrayByteBase64() method is inefficient for large byte arrays because it uses a temporary copy of the data to eliminate whitespace.

This is very wasteful for large arrays, and is completely unnecessary.

The code should just add a check for whitespace as part of the main loop.

Patch to follow



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Sebb made changes - 21/Jun/08 02:11 PM
Field Original Value New Value
Attachment Base64.patch [ 12384435 ]
Henri Yandell added a comment - 01/Jul/08 04:38 AM
Looks good. Patch applied.

I've also deprecated the discardWhitespace method. It's package private, but I guess someone could be extending Base64 and using that method through inheritance.


Henri Yandell made changes - 01/Jul/08 04:38 AM
Fix Version/s 1.4 [ 12311779 ]
Repository Revision Date User Message
ASF #672993 Tue Jul 01 04:39:01 UTC 2008 bayard Applying Sebb's patch from CODEC-71, improving the memory consumption of isArrayByteBase64(). I've also deprecated the discardWhitespace method as nothing uses it now
Files Changed
MODIFY /commons/proper/codec/trunk/src/java/org/apache/commons/codec/binary/Base64.java

Henri Yandell made changes - 01/Jul/08 04:55 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]