default ByteBuffer serialize(final Supplier<ByteBuffer> byteBufferSupplier,
                                 final T object) {
        final ByteBuffer byteBuffer = Objects.requireNonNull(byteBufferSupplier.get());
        try {
            serialize(byteBuffer, object);
        } catch (BufferOverflowException boe) {
            throw new RuntimeException(LogUtil.message("Buffer {} too small for value {}",
                    ByteBufferUtils.byteBufferInfo(byteBuffer),
                    object));
        }
        return byteBuffer;
    }
@param byteBufferSupplier A supplier of a {@link ByteBuffer} in a ready state for writing. The
                          supplier may or may not be called depending on the impl so only use
                          the return value to get the serialised form.
                          May throw a {@link RuntimeException} if the supplied buffer
                          is not big enough to hold the serialised form.
@param object             The object to be serialised.
@return The serialised form of the object, flipped and ready for reading.
stroom-lmdb/src/main/java/stroom/lmdb/serde/Serializer.java