public static SnapshotWriter create(File snapshot, String region, InternalCache cache)
      throws IOException {
    final GFSnapshotExporter out = new GFSnapshotExporter(snapshot, region, cache);
    return new SnapshotWriter() {
      @Override
      public void snapshotEntry(SnapshotRecord entry) throws IOException {
        out.writeSnapshotEntry(entry);
      }

      @Override
      public void snapshotComplete() throws IOException {
        out.close();
      }
    };
  }
Creates a snapshot file and provides a serializer to write entries to the snapshot.

@param snapshot the snapshot file
@param region the region name
@return the callback to allow the invoker to provide the snapshot entries
@throws IOException error writing the snapshot file
geode-core/src/main/java/org/apache/geode/internal/cache/snapshot/GFSnapshot.java