docs: private static void serializePrimitive(DataOutputStream dOut, Object primitive) throws IOException {
          if (primitive == null) {
              dOut.writeByte(VAL_NULL);
          } else {
              dOut.writeByte(VAL_ELEMENT);
              final Class<?> resolvedObjectClass = primitive.getClass();
              Serializer<Object> serializer = (Serializer<Object>) PRIMITIVE_SERIALIZERS_BY_CLASS.get(resolvedObjectClass);
              if (serializer == null) {
                  throw new IllegalStateException("Can't serialize resolved class " + resolvedObjectClass.getCanonicalName());
              }
              dOut.writeByte(serializer.getSerializerId());
              serializer.serialize(primitive, dOut);
          }
      }