classpath
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Constructing java.lang.String in constant pool


From: Patrick Doyle
Subject: Constructing java.lang.String in constant pool
Date: Wed, 27 Jun 2001 23:03:04 -0400 (EDT)

What is the best way for a JVM to instantiate a String for a constant pool
entry of type "CONSTANT_String"?  I'm looking for the most straightforward
approach that won't cause me a lot of grief down the road.  There are a
number of constructors for String; should I use one of those, or just use
my inside knowledge of the String class to construct an instance manually?

The closest thing to sanity I can think of is to convert the UTF8-encoded
characters into a char array and then use the String(char[], length)
constructor.  AFAIK I would have to implement the conversion myself.

Does this seem like the right approach?

Thanks!

--
Patrick Doyle
address@hidden




reply via email to

[Prev in Thread] Current Thread [Next in Thread]