Santhosh Shettigar Santhosh Shettigar - 1 year ago 108
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);
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download