util: Added DynamicByteBuffer.ensurePut for ByteBuffer and use in BinaryXmlEncoder.writeBuffer.