// memory and then splitting them, potentially leading to excessive
// buffering. An alternative solution is shown in SharedStreamMultiMarshallerTest
// but it requires some special treatment - iow, hacking :)
input.readFully(paramsRaw);
ByteArrayInputStream is = new ByteArrayInputStream(paramsRaw, 0, paramsRaw.length);
ObjectInput paramsInput = marshaller.startObjectInput(is, true);
// Not ideal, but the alternative (without changing API), would have been
// using thread locals which are expensive to retrieve.
// Remember that the aim with externalizers is for them to be stateless.
if (paramsInput instanceof ExtendedRiverUnmarshaller)
((ExtendedRiverUnmarshaller) paramsInput).setInfinispanMarshaller(marshaller);