private void saveDataSerializer(DataSerializer ds) {
    lock(true);
    try {
      if (!compactInProgress && dsIds.contains(ds.getId())) {
        // dataSerializer already written to disk so just return
        return;
      }
      final byte[] classNameBytes = classToBytes(ds.getClass());
      ByteBuffer bb = getIFWriteBuffer(1 + 4 + classNameBytes.length + 1);
      bb.put(IFREC_DATA_SERIALIZER_ID);
      bb.putInt(classNameBytes.length);
      bb.put(classNameBytes);
      bb.put(END_OF_RECORD_ID);
      writeIFRecord(bb);
    } catch (IOException ex) {
      throw new DiskAccessException(
          String.format("Failed saving data serializer to disk because: %s",
              ex),
          parent);
    } finally {
      unlock(true);
    }
  }
Write the specified DataSerializer to the file.
geode-core/src/main/java/org/apache/geode/internal/cache/DiskInitFile.java