return CUSTOM_MARSHALLER;
}
@Override
protected ByteBuffer objectToBuffer(Object obj, int estimatedSize) throws IOException, InterruptedException {
ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(estimatedSize);
ObjectOutput out = startObjectOutput(baos, false);
try {
defaultMarshaller.objectToObjectStream(obj, out);
} catch (java.io.NotSerializableException nse) {
if (log.isDebugEnabled()) log.debug("Object is not serializable", nse);
throw new org.infinispan.marshall.NotSerializableException(nse.getMessage(), nse.getCause());
} catch (IOException ioe) {
if (ioe.getCause() instanceof InterruptedException) {
if (log.isTraceEnabled()) log.trace("Interrupted exception while marshalling", ioe.getCause());
throw (InterruptedException) ioe.getCause();
} else {
log.error("Exception while marshalling object", ioe);
throw ioe;
}
} finally {
finishObjectOutput(out);
}
return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
}