Is it possible to copy the contents of a file to a container then delete the file instantaneously, so in essence I am taking a snapshot of the file but not storing the contents in another temp file but rather in a java object
Pseudocode/code of what I am trying to accomplish
final File localPushFile = new File("testfile.txt");
if(!(localPushFile.exists())
{
FileReader filestream = new FileReader(localPushFile);
Object a = filestream //object variable will store snapshot of the file I am trying to copy
deletefile(localPushFile) //method that will delete the file as soon as a snapshot is taken
}
I am assuming I cant use BufferedReader as that just acts as a temp buffer?