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 (log.isTraceEnabled()) log.trace("Exception while marshalling object", ioe);
if (ioe.getCause() instanceof InterruptedException)
throw (InterruptedException) ioe.getCause();
else
throw ioe;
} finally {
finishObjectOutput(out);
}
return new ByteBuffer(baos.getRawBuffer(), 0, baos.size());
}