|
From: <php...@li...> - 2007-08-27 18:57:43
|
Hi Jonathan,
> Last night, I discovered that I needed to use java_values() on the byte array
Yes. java_values() converts a Java object to the appropriate PHP value(s), a PHP binary string in
this case.
However, people shouldn't need to write unnatural code; whenever PHP needs to convert a proxy into
a String, it calls $proxy->__toString(). On the server side the method is called
"ObjectToString(value)".
What about adding the following code to JavaBridge.java:
public String ObjectToString(byte[] value) {
// FIXME: use the StringCache
try {
return new String( (byte[])castToString(value), getOptions().getFileEncoding());
} catch (IllegalEncodingException ex) {
// shouldn't happen
Util.printStackTrace(ex);
return new String( (byte[])castToString(value) );
}
}
Regards,
Jost Boekemeier
Machen Sie Yahoo! zu Ihrer Startseite. Los geht's:
http://de.yahoo.com/set
|