@Override
protected ByteBuffer objectToBuffer(Object o, int estimatedSize) throws IOException {
ExposedByteArrayOutputStream baos = new ExposedByteArrayOutputStream(estimatedSize);
Encoder encoder = AVRO_ENCODER_FACTORY.directBinaryEncoder(baos, null);
objectToBuffer(o, encoder);
return new ByteBufferImpl(baos.getRawBuffer(), 0, baos.size());
}