Write and read multiple objects to file

后端 未结 3 946
后悔当初
后悔当初 2020-12-03 16:24

I am designing an handwriting application for android.

I would like to write information (class LogInfo) into a log file, every time the user presses th

3条回答
  •  孤街浪徒
    2020-12-03 16:49

    @EJP is right.it cannot append to an existing file created with an ObjectOutputStream. You can do the following steps to fix it: 1. keep ObjectOutputStream object reference 2. after writeObject() having been called, do not call close() 3. provide a method to close ObjectOutputStream.

提交回复
热议问题