commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeffrey Dever <jsde...@sympatico.ca>
Subject Re: [codec] RE: Base64.java
Date Tue, 04 Feb 2003 21:09:31 GMT
>
>
>Base64 is well understood just as a general encoding scheme outside of RFC
>2045 MIME.   RFC 2045 MIME adds a further requirement that the content be
>put into 76 character chunks.  Past 1.1 we could also talk about Base64.java
>providing the core "base64" encoding, and MIMEBase64.java extending Base64
>and adding "pre" and "post" processing to the algorithm.
>  
>
As long as efficiency is held as a key requirement over OO purity. 
 After all, Base64 is functional in nature.  

There should only be one memory allocation for the output, and one 
iteration over the input.  It would be inefficient to allocate the 
output array, iterate over the input for the general algorithm, then 
have to reallocate another array and iterate over the intermediate 
output just to drop in '\n' every 76 characters.

But in the HttpClient case, we only encode/decode small inputs (few 
hundred bytes) anyway.

Jandalf.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message