STOMP - EOFException when content-length header missing

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

STOMP - EOFException when content-length header missing

gdrouet
This post has NOT been accepted by the mailing list yet.
Hi,

I wrote a unit test that direclty uses the StompWireFormat. The following code throws an EOFException.

String frame = "SEND\n" +
            "destination:/queue/a\n" +
            "content-type:text/plain\n" +
            "\n" +
            "hello queue a\n" +
            "^@";
new StompWireFormat().unmarshal(new DataInputStream(new ByteArrayInputStream(frame.getBytes())));

When I read the code, I see that when the content-length header is missing, a while loop is performed like this: while ((b = in.readByte()) != 0)

Seems that DataInputStream class does not returns 0...

Any mistake in my code?

Thanks