RecentFiles.java 文件源码

java
阅读 35 收藏 0 点赞 0 评论 0

项目:jaer 作者:
void putPrefs(){
    try {
        // Serialize to a byte array
        ByteArrayOutputStream bos = new ByteArrayOutputStream() ;
        ObjectOutput out = new ObjectOutputStream(bos) ;
        out.writeObject(fileList);
        out.close();

        // Get the bytes of the serialized object
        byte[] buf = bos.toByteArray();
        prefs.putByteArray("recentFiles", buf);
    } catch (IOException e) {
        e.printStackTrace();
    }catch(IllegalArgumentException e2){
        log.warning("RecentFiles tried to store too many files in Preferences, fileList has "+fileList.size()+" files");
    }

}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号