DIRMINA-946 fix for the dumping function (it was crashing with ByteBuffers that are not backed by an array or that are readonly)