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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to