users@websocket-spec.java.net

[jsr356-users] Re: _at_WebSocketMessage and return "Java primitive or class equivalent"

From: Joakim Erdfelt <joakim_at_intalio.com>
Date: Thu, 14 Feb 2013 09:41:40 -0700

And yes, i'm also aware that the javadoc says "If the method uses a class
equivalent of a Java primitive as a return value, the implementation must
construct the text message from the Java primitive equivalent as described
above."

But for some primitives, like byte, what is the text message format of it?
(quite possibly an invalid UTF8 sequence)
Or is this just saying to rely on java.lang.Byte.toString(byte) in this
scenario?

--
Joakim Erdfelt <joakim_at_intalio.com>
webtide.com <http://www.webtide.com/>
Developer advice, services and support
from the Jetty & CometD experts
eclipse.org/jetty - cometd.org
On Thu, Feb 14, 2013 at 9:36 AM, Joakim Erdfelt <joakim_at_intalio.com> wrote:
> In the return types section of the @WebSocketMessage javadoc it says as
> one of the possible options
>
> "any Java primitive or class equivalent"
>
> I'm assuming this means any of the following ...
>
> int - java.lang.Integer
> long - java.lang.Long
> boolean - java.lang.Boolean
> byte - java.lang.Byte
> char - java.lang.Character
> double - java.lang.Double
> float - java.lang.Float
> short - java.lang.Short
>
> Now, I'm curious, what message format type should these return?
> Binary? Text?
> If text, what should the format be?
> If binary, what byte order?
>
> This section also says "any Java primitive or class equivalent" which is
> good, and makes the message format easy enough to determine.
> Just the ones above are a bit ambiguous
>
> --
> Joakim Erdfelt <joakim_at_intalio.com>
> webtide.com <http://www.webtide.com/>
> Developer advice, services and support
> from the Jetty & CometD experts
> eclipse.org/jetty - cometd.org
>