docs: @Override
    public IoBuffer putObject(Object o) {
      int oldPos = position();
      skip(4); // Make a room for the length field.
      try {
        ObjectOutputStream out = new ObjectOutputStream(asOutputStream()) {
          @Override
          protected void writeClassDescriptor(ObjectStreamClass desc) throws IOException {
            if (desc.forClass().isPrimitive()) {
              write(0);
              super.writeClassDescriptor(desc);
            } else {
              write(1);
              writeUTF(desc.getName());
            }
          }
        };
        out.writeObject(o);
        out.flush();
      } catch (IOException e) {
        throw new BufferDataException(e);
      }
  
      // Fill the length field
      int newPos = position();
      position(oldPos);
      putInt(newPos - oldPos - 4);
      position(newPos);
      return this;
    }