[zeromq-dev] Subscribing in JAVA api

Martin Sustrik sustrik at 250bpm.com
Thu May 13 12:27:19 CEST 2010


gonzalo diethelm wrote:
>> If you change the code to always use "env->GetStringUTFLength
> (optval);"
>> then from your java code you can do "animals.mammals\u0000" for
> precise
>> match or "animals.mammals" for "wildcard" matching. Keeps things
> simple
>> since there is no need for passing length which is a bit more error
> prone
>> and so un-java :-)
> 
> I agree it is not very Java-ish. On the other hand, it looks closer to
> the original C implementation, so there might be fewer surprises this
> way.
> 
> I would like input on this from other members in the list.

As far as I understand the Java string object contains the length. Thus 
supplying the length as second parameter is superfluous IMO.

Martin




More information about the zeromq-dev mailing list