commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Gregory <GGreg...@seagullsoftware.com>
Subject RE: [CODEC] Base-n refactoring
Date Thu, 27 Jan 2011 20:54:43 GMT
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Thursday, January 27, 2011 15:13
> To: Commons Developers List
> Subject: [CODEC] Base-n refactoring
> 
> I think I've now got the Base32 classes to a reasonable state. (More
> tests are surely needed).
> 
> I decided to drop all the static encode/decode methods, as this
> simplifies the class considerably.
> Perhaps one are two are needed, but it might be best to release
> without them and add later if there is a big demand.
> 
> The default buffer size is quite large (8192), so I added an
> overridable method to define it.
> Users would have to subclass Base32 to use it, but at least the option is
> there.
> I did not want to add yet more parameters to the ctors.
> If we ever decide to add an Options class then it could be added there.
> 
> If the API looks OK, I'd like to rework the Base64 classes to use it.
> 
> Thoughts?

Nice work! Thank you.

WRT hasData(). We have:

if (!baseNCodec.hasData()) {

This is better IMO:

if (baseNCodec.isEmpty()) {

I would rename hasData to isEmpty and adjust (there is only call site.)

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


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


Mime
View raw message