Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Base64 encode decode jars

 
Sam Gehouse
Ranch Hand
Posts: 281
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Could you please list a few good links for getting jars for Base64 encoding and decoding using Java?
 
Grant Gainey
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://iharder.sourceforge.net/base64/

'Course, I just use the sun.misc.BASE64En/Decoder classes - they're not officially supported, but they do the job.

Grant
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

they're not officially supported, but they do the job.

The important point is that it ties you to one particular implementation of the VM. Are you (anyone who wants to use base64) willing to accept this limitation at the expense of saving a few lines of code? Your call. I've written a decoder/encoder, but it's proprietrary - I'll try to get one out in a OSS release some time.
 
Grant Gainey
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Morris:

The important point is that it ties you to one particular implementation of the VM. Are you (anyone who wants to use base64) willing to accept this limitation at the expense of saving a few lines of code? Your call.


True enough. It's more than just the "few lines of code", though - it's adding Yet Another Jar to the project/distribution, and the hassle of convincing your legal team that it's OK to add as part of the product.

Originally posted by Tony Morris:

I've written a decoder/encoder, but it's proprietrary - I'll try to get one out in a OSS release some time.

Why does everybody write their own B64 code? There are MANY public domain implementations available (as one would expect from a public, easy-to-implement standard). I've used B64 for...a very long time, actually...but I've never implemented it myself. But then, I suspect the question is its own answer - it is an easy thing to implement, and it can certainly be a pain getting approval for adding that one more jarfile to the product. Never mind - I'll go back to my corner now...

Grant

[Edited for tag errors]
[ October 20, 2005: Message edited by: Grant Gainey ]
 
Ray Horn
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try the Jakarta Commons Project (open source). Here is a page
into an article explaining the Base64 codec. I have not used it
myself but hopefully the article points you in the right direction.

http://www.onjava.com/pub/a/onjava/2003/07/09/commons.html
 
Tony Morris
Ranch Hand
Posts: 1608
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

the hassle of convincing your legal team

...and here I was thinking you were sympathising with me
I wrote my own base64 encoder/decoder for two reasons:
a) my legal team with regard to shipping OSS
b) The existing encoders/decoders are suboptimal in my opinion (I didn't reinvent the wheel; I made it more round)
 
Grant Gainey
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Tony Morris:

...and here I was thinking you were sympathising with me


Heh. I always have sympathy for developers trying to get OSS source into their products. At one point, heard a company say "it's more cost effective for us to pay developers to reimplement that functionality than to pay the lawyers to investigate the legal issues." (Not said to me, thank goodness - but I know it happens).

Originally posted by Tony Morris:

I wrote my own base64 encoder/decoder for two reasons:
a) my legal team with regard to shipping OSS
b) The existing encoders/decoders are suboptimal in my opinion (I didn't reinvent the wheel; I made it more round)


Fair enough. For myself, I've tripped over enough square (or even triangular) wheels in large applications that I've gotten better at leaving the mostly-round parts alone...

Grant
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic