You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Sanjeev Srivastava <sa...@yahoo.co.uk> on 2005/03/10 03:35:03 UTC

Help - Byte [] to String

Hi All 

Can anybody tell me how to convert this Byte [] to
String..

 byte[] buf =
x509certificate.getPublicKey().getEncoded();


Please help....

Thanks,
Sanjeev


Send instant messages to your online friends http://uk.messenger.yahoo.com 

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


Re: Help - Byte [] to String

Posted by xue daoming <xu...@gmail.com>.
I think you can do as just below:
byte[] buf  = x509certificate.getPublicKey().getEncoded();
String s = new String(buf);


On Thu, 10 Mar 2005 02:35:03 +0000 (GMT), Sanjeev Srivastava
<sa...@yahoo.co.uk> wrote:
> Hi All
> 
> Can anybody tell me how to convert this Byte [] to
> String..
> 
> byte[] buf =
> x509certificate.getPublicKey().getEncoded();
> 
> Please help....
> 
> Thanks,
> Sanjeev
> 
> Send instant messages to your online friends http://uk.messenger.yahoo.com
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
> 
>

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


Re:OT Help - Byte [] to String

Posted by Parsons Technical Services <pa...@earthlink.net>.
String cert = String(buf);

http://java.sun.com/j2se/1.4.2/docs/api/index.html
And look up the String class

Doug

----- Original Message ----- 
From: "Sanjeev Srivastava" <sa...@yahoo.co.uk>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Wednesday, March 09, 2005 9:35 PM
Subject: Help - Byte [] to String


> Hi All
>
> Can anybody tell me how to convert this Byte [] to
> String..
>
> byte[] buf =
> x509certificate.getPublicKey().getEncoded();
>
>
> Please help....
>
> Thanks,
> Sanjeev
>
>
> Send instant messages to your online friends http://uk.messenger.yahoo.com
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>
> 



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