code: @SuppressWarnings("unchecked")
    private BufferOutput writeById(int id, Object object, BufferOutput output, TypeSerializer serializer) {
      for (Identifier identifier : Identifier.values()) {
        if (identifier.accept(id)) {
          identifier.write(id, output.writeByte(identifier.code()));
          serializer.write(object, output, this);
          return output;
        }
      }
      throw new SerializationException("invalid type ID: " + id);
    }
docs: Writes an object to the buffer using the given serialization ID.