You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Wendy Smoak <ja...@wendysmoak.com> on 2005/02/09 01:49:02 UTC

Re: [httpclient] How to send and recieve Serialized Object using Http Client

From: "Sanjeev Tripathi" <sa...@parago.com>

> Can any one give me url for getting Base64OutputStream and
> Base64InputStream classes on google.

Did you see the reply on commons-user earlier today?  (You're still posting
to the 'dev' list.)  Matt Goodwin posted code that gets you from an object
to a base 64 encoded byte[].

You can see his message in the archives here:
http://www.mail-archive.com/commons-user%40jakarta.apache.org/msg10036.html

Info on subscribing to commons-user is here:
http://jakarta.apache.org/site/mail2.html#Commons

-- 
Wendy Smoak


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


Re: [httpclient] How to send and recieve Serialized Object using Http Client

Posted by Simon Kitching <sk...@apache.org>.
On Tue, 2005-02-08 at 17:49 -0700, Wendy Smoak wrote:
> From: "Sanjeev Tripathi" <sa...@parago.com>
> 
> > Can any one give me url for getting Base64OutputStream and
> > Base64InputStream classes on google.
> 
> Did you see the reply on commons-user earlier today?  (You're still posting
> to the 'dev' list.)  Matt Goodwin posted code that gets you from an object
> to a base 64 encoded byte[].
> 
> You can see his message in the archives here:
> http://www.mail-archive.com/commons-user%40jakarta.apache.org/msg10036.html
> 

Hi Sanjeev,

It looks to me like you are trying to encode a *String* containing a
password. In this case, you don't want to "serialize an object" (as
described in Matt's email), but instead use:

   byte[] passwordAsBytes = password.getBytes(encodingName);

You will need to make sure you use an encoding which the receiver of the
encoded password expects. Normally, "ISO-8859-1" (aka "ISO-LATIN-1") is
the best choice but if passwords are in chinese/japanese/hindi/etc then
you will need to think more carefully about the encoding you use.

If you're planning to store the password in a database or similar, and
later read it back into a java app, then the encoding you use just has
to be the same as the one you use after decoding the password to convert
the decoded byte[] array back to a String.

Regards,

Simon


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