0

When you are storing a text in a file and keep on adding to it, than is there any size limit for the file? Can some crash or error lead to a loss. The app needs to save a month long diary data.

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216
Snowrain
  • 3
  • 5

2 Answers2

0

You can use any file format. For being safe from large size expect a OutOfMemoryException while handling a large file. So handle a (expected) large file with a OutOfMemoryException catch block.

Birendra Singh
  • 842
  • 11
  • 19
0

Yes, you can defiantly run out of memory when handling large files, there for a good idea will be to check the available space before writing to the file.

You can find how to do this in here: https://stackoverflow.com/a/8133437/1129332

Ilya Gazman
  • 31,250
  • 24
  • 137
  • 216