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


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

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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Eric Sosman <esosman@comcast-dot-net.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: End of String Problem: Sending C++ string to java code
Date Tue, 08 Oct 2013 20:30:34 -0400
Organization A noiseless patient Spider
Lines 29
Message-ID <l3283f$r6r$1@dont-email.me> (permalink)
References <177b1b66-ea89-4995-ab6c-9187bb754895@googlegroups.com> <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>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Wed, 9 Oct 2013 00:30:40 +0000 (UTC)
Injection-Info mx05.eternal-september.org; posting-host="0d73d8cc209bff1c6395088b400d0605"; logging-data="27867"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+cAKuHdeMkXpV0x72Gxaci"
User-Agent Mozilla/5.0 (Windows NT 5.1; rv:24.0) Gecko/20100101 Thunderbird/24.0
In-Reply-To <deserialize-20131009022202@ram.dialup.fu-berlin.de>
Cancel-Lock sha1:2Dx0UmF6xhhWra0n7Mk2ibtTZ54=
Xref csiph.com comp.lang.java.programmer:26244

Show key headers only | View raw


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.)

-- 
Eric Sosman
esosman@comcast-dot-net.invalid

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