public static ByteBuffer clone(ByteBuffer original) {
    ByteBuffer clone = ByteBuffer.allocate(original.capacity());
    original.rewind();
    clone.put(original);
    original.rewind();
    clone.flip();
    return clone;
  }
Replace newFile with oldFile. If the file system does not support atomic file replacement then
delete the old file first.

@param newFile the new file.
@param oldFile the file to be replaced.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/IOUtils.java