Allow user to pass in byte[] to encode method
MiGBase64 is a very fast and small Base64 Codec written in Java
Brought to you by:
mgrev
Hi Mikael,
Could you please add the following two methods to your encoder? This would be very helpful if like in my case you have a cached byte array that you want to write to.
/**
* Returns the size required to encode sArr
*/
int getEncodedSize(byte[] sArr,
boolean lineSep)
/**
* Encodes sArr into dArr starting at dOffset
*/
void encodeToByte(byte[] sArr,
byte[] dArr,
int dOffset,
boolean lineSep)
I've attached a modified Base64.java file with these methods implemented, not 100% sure they work though. Do you have a JUnit test case for this class? Otherwise I could get started on one.
Regards,
Michael
Modified Base64.java
Logged In: YES
user_id=1097780
Originator: NO
Hello Michael,
Sorry for the late response but I thought that sourceforge would send notification mails and haven't checked here until now.
Can I add you as a developer so that you can commit the files?
I have no JUnit tests. I tested it very thoroughly against the other implementations but never did it as a unit test, which I regret now of course. If you still want to add this you are very welcome. You can them also add yourself as an author to the license denoting what you've added.
Cheers,
Mikael