@Override
    protected void save() {
        try (ObjectOutputStream os = new ObjectOutputStream(Files.newOutputStream(file.toPath()))) {
            Map<byte[], byte[]> raw = new HashMap<>();
            for (Map.Entry<ByteBuffer, ByteBuffer> mapEntry : data.entrySet()) {
                byte[] key = (mapEntry.getKey() != null) ? mapEntry.getKey().array() : null;
                byte[] value = (mapEntry.getValue() != null) ? mapEntry.getValue().array() : null;
                raw.put(key, value);
            }
            os.writeObject(raw);
        } catch (IOException e) {
            throw new ConnectException(e);
        }
    }
Implementation of OffsetBackingStore that saves data locally to a file. To ensure this behaves
similarly to a real backing store, operations are executed asynchronously on a background thread.
The offset position can be specified
inlong-agent/agent-plugins/src/main/java/org/apache/inlong/agent/plugin/utils/InLongFileOffsetBackingStore.java