Santhosh Shettigar Santhosh Shettigar - 9 months ago 56
Android Question

How to delete only the content of a file in java?

May i please know how can i delete the content of the file in java?
Thanks in advance.

Answer Source

How about this:

new RandomAccessFile(fileName).setLength(0);