You could wrap the two streams using CountingInputStream/CountingOutputStream from commons-io.
Andreas On Wed, May 11, 2011 at 11:24, Lorenzo Nardi <[email protected]> wrote: > Hi all, > > hi have to retrieve incoming and outgoing axiom (doom impl) messages > lenght without building them. > > I'm in a http servlet, but transfer encoding is chunked, so can't get > any lenght info from the transport layer. The message is modified by > servlet's business logic, so the incoming message's size will be > different from outgoing one. > > The messages lenght is needed at the end of business logic, after the > serializeAndConsume of the message. I should keep memory of the bytes > readed from the request's InputStream and of the byte produced by the > serializeAndConsume of the response. > > Any suggestion how to do this? > > Thx, > Lorenzo > >
