users@jersey.java.net

[Jersey] Re: Anybody have any luck with ChunkedOutput outside of String payload

From: Mark Thornton <mthornton_at_optrak.com>
Date: Tue, 8 Apr 2014 22:25:46 +0100

The chunking has nothing to do with chunking at the http level. Effectively
you just have a stream of bytes separated by some unique sequence of bytes.
For sending 'chunks' of xml (from JAXB) a useful separator is '&&' as I
don't think this can occur within legal xml (and encoded in UTF-8 it is
just two bytes).

Mark Thornton

On Tuesday, 8 April 2014, Anil Pinto <anilrpinto_at_outlook.com> wrote:

> Hello,
>
> I have been wrestling with the ChunkedOutput/ChunkedInput implementation
> in Jersey 2.7 and am not having much luck retrieving chunks as the example
> promises.
>
> I need to exchange chunks of mixed content type, so I started with
> MultiPart as th obvious choice, but no luck there.
>
> Then to atleast make some progress I tried to send a set of chunked JAXB
> objects (instead of simple Strings as in the example) but no luck there as
> well as only first object is returned to the client.
>
> If the ChunkedInput is read as a String I see a JSON for each chunk but
> all clubbed together and returned as one set which does not help.
>
> I am suspecting something going on with the ChunkParser and need some
> guidance.
>
> Any help to move ahead is greatly appreciated.
>
> Anil.
>