> On 20 Feb 2018, at 20:49, Simone Bordet <simone.bor...@gmail.com> wrote: > > Hi, > > On Tue, Feb 20, 2018 at 9:35 PM, Chris Hegarty <chris.hega...@oracle.com> > wrote: >> Optimistically, if the whole message is read from the underlying >> socket in one native read ( small messages ), then the whole >> message will be in a single byte buffer, zero copy. > > Good. > >> If not, then to re-assemble the whole message into a single byte buffer >> will require some copying ( there is no composite byte buffer). > > I don't see why the message should be reassembled, given > MessagePart.[FIRST|PART|LAST] ? > It's not that the user can ask for the kind of MessagePart, e.g. ask > only for WHOLE messages that the implementation must reassemble on her > behalf, no ? > So it will *always* be the case that zero copy is possible, right ?
Correct. I though that the conversation was related to the Java EE API where the API supports requesting WHOLE messages, which cannot be guaranteed to be zero-copy. The Java SE API does not support requesting WHOLE messages so does not have this issue. -Chris.