Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Inicialization of an UnsignedByte variable

Alicia Sánchez-Mora

2007-02-14

Replies:

Hi,

I want to assign a value to a variable of type UnsignedByte. In
the function it looks like this:

public String function (){

final UnsignedByte ptr =new UnsignedByte() ;
final Base64 blob = new Base64 (ptr, 10, "id","type","options"*);
...
}

I want the "ptr" variable to have a value other than empty. The constructor
of UnsignedByte is defined as public UnsignedByte(java.lang.String sValue)
When I initialized ptr with final

UnsignedByte ptr = new UnsignedByte("abc");

the result was that tomcat got hung up and throws a NumberFormatException.
This is because a string can not be converted to a long. So what is the
appropriate way…

Thanks in advance,

Alicia
©2008 junlu.com - Jax Systems, LLC, U.S.A.