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 Wed, 26 Jan 2011 18:25:47 GMT
> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: Wednesday, January 26, 2011 11:05
> To: Commons Developers List
> Subject: [CODEC] Base-n refactoring
> 
> I have just committed a reworking of the Base32 class, and added I/O
> stream classes for it.

Thank you for taking the initiative on this one.

> 
> As can be seen, the specific I/O classes are pretty simple, as most of
> the code is in the super-classes.
> I think these are probably good enough (apart from the name!)
> 
> Likewise, the Base32 super-class (currently BasedCodec, but a better
> name would be BaseNCodec - props to Gary) extracts quite a lot of the
> common functionality into the super class.
> 
> There are still some common methods that could be added to the BaseNCodec
> class.
> 
> For example, it seems to me that it would be useful to be able to
> invoke the various alphabet-check methods on the Basenn instances,
> rather than having to invoke them as static methods on the class.
> 
> This is particularly true of the Base32 class, because it has two
> different decoding tables, but is partially true of Base64.
> For example, Base63 currently disallows '+' and '/' as line-ending
> characters even if the standard encoding is being used - and
> vice-versa.
> 
> So I'd like to add methods called (e.g) isValidForAlphabet() to the super-
> class.
> 
> Thoughts?

Seems like a good idea. Right now I see several isBase32 methods which would make more sense
as isValidForAlphabet or isValidInAlphabet or just isInAlphabet.

> 
> Also once the super-class design is finished I'd like to retrofit it
> to Base64 and the I/O streams.

Which begs for full support of the RFC with... Base16!
 
That should really clean up the refactoring :)

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