持久化數(shù)據(jù)

2018-12-16 11:04 更新
遇到問題?歡迎訪問GitHub頁面提交Issue https://github.com/SumiMakito/QuickKV ,同時(shí)也歡迎收藏項(xiàng)目

本章節(jié)很重要,借助持久化數(shù)據(jù)將可從內(nèi)存保存至文件,這樣你就可以在任何時(shí)候讀取與復(fù)用持久化后的數(shù)據(jù)。

QuickKV將自動(dòng)載入已保存的持久化數(shù)據(jù)庫。

注意:只有String/Integer/Long/Double/Float/Boolean/JSONObject/JSONArray類型的數(shù)據(jù)才可被持久化。

0.8.1版本后引入異步支持

qkvdb.persist(); //return boolean
// or persist asynchronously ...
qkvdb.persist(new KeyValueDatabase.Callback(){
    @Override
    public void onSuccess(){
        //Do something...
    }
    @Override
    public void onFailed(){
        //Do something...
    }
}); //return void(nothing)
以上內(nèi)容是否對(duì)您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號(hào)
微信公眾號(hào)

編程獅公眾號(hào)