classpath
[Top][All Lists]
Advanced

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

Re: Constructing java.lang.String in constant pool


From: Tom Tromey
Subject: Re: Constructing java.lang.String in constant pool
Date: 28 Jun 2001 09:43:55 -0600

>>>>> "Patrick" == Patrick Doyle <address@hidden> writes:

Patrick> What is the best way for a JVM to instantiate a String for a
Patrick> constant pool entry of type "CONSTANT_String"?

Use the JNI `NewString' call.  It takes a nul-terminated UTF-8 encoded
`char *' and returns a jstring.  The termination will probably be a
problem for you :-(

Or maybe you mean you want to implement this call.  In that case your
plan of using String(char[]) sounds as good as any.

Tom



reply via email to

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