public double write(ByteBuffer buffer, WALMetaData metaData) throws IOException {
    // update metadata
    updateMetaData(metaData);
    // flush buffer
    return write(buffer);
  }
Writes buffer and update its' metadata.

@throws IOException when failing to write
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/io/WALWriter.java