docs: private ByteBufferSerializer<?>[] writeHeader(BundleStreamSource source, ByteBuffer buffer, WritableByteChannel output) throws IOException {
      final BundleMeta meta = source.getMeta();
      final int nummeta = meta.size();
      @SuppressWarnings("rawtypes")
      final ByteBufferSerializer[] serializers = new ByteBufferSerializer[1 + nummeta];
      // Write our magic ID first.
      assert (buffer.position() == 0) : "Buffer is supposed to be at 0.";
      buffer.putInt(MAGIC);
      // Write the number of metas next.
      // For compatibility with earlier versions, treat DBIDs as extra type
      if(source.hasDBIDs()) {
        buffer.putInt(1 + nummeta);
        ByteBufferSerializer<DBID> ser = DBIDFactory.FACTORY.getDBIDSerializer();
        TypeInformationSerializer.STATIC.toByteBuffer(buffer, new SimpleTypeInformation<>(DBID.class, ser));
        serializers[0] = ser;
      }
      else {
        buffer.putInt(nummeta);
      }
      for(int i = 0; i < nummeta; i++) {
        SimpleTypeInformation<?> type = meta.get(i);
        ByteBufferSerializer<?> ser = type.getSerializer();
        if(ser == null) {
          throw new AbortException("Cannot serialize - no serializer found for type: " + type.toString());
        }
        TypeInformationSerializer.STATIC.toByteBuffer(buffer, type);
        serializers[i + 1] = ser;
      }
      return serializers;
    }