Hello, all!
I'm a newbie in JAVA, can anyone tell me how can a byte[] be converted into String?
The situation is:
... somewhere ....
tst=new String(qwertz);
somemethod(tst.getBytes()) ;
..............................
public void somemethod(byte[] oid)
{
String tmp;
tmp=new String();
tmp=oid.toString();
System.out.println("TEST : " + tmp2);
}
This thing gives me the same as "System.out.println("TEST : " + oid);" How could I get the original string "qwertz" back?
Thanks
I'm a newbie in JAVA, can anyone tell me how can a byte[] be converted into String?
The situation is:
... somewhere ....
tst=new String(qwertz);
somemethod(tst.getBytes()) ;
..............................
public void somemethod(byte[] oid)
{
String tmp;
tmp=new String();
tmp=oid.toString();
System.out.println("TEST : " + tmp2);
}
This thing gives me the same as "System.out.println("TEST : " + oid);" How could I get the original string "qwertz" back?
Thanks