I want to copy the content of file \'A\' to file \'B\'. after the copying is done I want to clear the content of file \'A\' and want to write on it from its beginning. I can
Simple, write nothing!
FileOutputStream writer = new FileOutputStream("file.txt"); writer.write(("").getBytes()); writer.close();