Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #26248

Re: End of String Problem: Sending C++ string to java code

From Mark <i@dontgetlotsofspamanymore.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: End of String Problem: Sending C++ string to java code
Date 2013-10-09 15:29 +0100
Message-ID <r0qa59hehitjaqm376t30frp5qf33tkkh0@4ax.com> (permalink)
References (1 earlier) <string-20131009000109@ram.dialup.fu-berlin.de> <serializer-20131009003629@ram.dialup.fu-berlin.de> <serialization-20131009005533@ram.dialup.fu-berlin.de> <deserialize-20131009022202@ram.dialup.fu-berlin.de> <l3283f$r6r$1@dont-email.me>

Show all headers | View raw


On Tue, 08 Oct 2013 20:30:34 -0400, Eric Sosman
<esosman@comcast-dot-net.invalid> wrote:

>On 10/8/2013 8:22 PM, Stefan Ram wrote:
>> ram@zedat.fu-berlin.de (Stefan Ram) writes:
>>> template< typename S >void serialize( S const s )
>>
>>    The deserializer in Java, a draft, not extensively tested:
>>
>> public final class Main
>> {
>>    public static java.lang.Object deserialize( final java.lang.String s )
>>    throws java.lang.Throwable
>>    { return new javax.script.ScriptEngineManager().getEngineByName( "JavaScript" )
>>      .eval( s.replace( "{", "[" ).replace( "}", "]" ) +" .join( '' )" ); }
>>
>>    public static void main( final java.lang.String[] args )
>>    throws java.lang.Throwable
>>    { java.lang.System.out.println( deserialize( "{ '\\x61', '\\x62', '\\x63' }" )); }}
>
>     Granted, "efficiency" is a dirty word nowadays ...
>
>     ... but ...
>
>     ... really?  Is this what it takes to transport a String
>across the JNI/Java interface?  REALLY?
>
>     (Not a JNI expert, just someone about to barf.)

If using JNI all he could use the NewStringUTF function.
-- 
(\__/)  M.
(='.'=) If a man stands in a forest and no woman is around
(")_(") is he still wrong?

Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

End of String Problem: Sending C++ string to java code clusardi2k@aol.com - 2013-10-08 09:56 -0700
  Re: End of String Problem: Sending C++ string to java code Arivald <NOSPAMarivald@interia.pl> - 2013-10-08 20:05 +0200
  Re: End of String Problem: Sending C++ string to java code Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2013-10-08 11:13 -0700
  Re: End of String Problem: Sending C++ string to java code Eric Sosman <esosman@comcast-dot-net.invalid> - 2013-10-08 20:30 -0400
    Re: End of String Problem: Sending C++ string to java code Mark <i@dontgetlotsofspamanymore.invalid> - 2013-10-09 15:29 +0100
    Re: End of String Problem: Sending C++ string to java code "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-10-09 15:35 +0100
  Re: End of String Problem: Sending C++ string to java code Jim Janney <jjanney@shell.xmission.com> - 2013-10-09 10:50 -0600
    Re: End of String Problem: Sending C++ string to java code Jim Janney <jjanney@shell.xmission.com> - 2013-10-09 11:03 -0600

csiph-web