How could I write into
File file = new File('test.txt');
I did something like this:
OutputStream os = new FileOutputStream(file, true); os.write("data".getBytes(), 0, "data".length()); os.flush(); os.close();
But I need to use os as File again, how could I convert it back to File?