I was wondering if there was a way to determine if any streams are open in a program?
I am using some of my code and some of another, and my goal is to be able to write to the same file multiple times, erasing it and rewriting every time. However, I think somewhere, the code belonging to this other group may have forgotten to close a stream, or that Java cannot handle it, maybe? It always writes at the end of the file, instead of at the beginning of a blank file. It will not delete and I cannot rename it if it has already been opened by the program.
If it is an open stream problem, I want to close the stream (which I have gone through the code, and cannot seem to find the open stream). Or if Java cannot handle it, is there a good way (besides making destroy methods) for me to be able to reset/kill objects to be reinstanciated?
Or is there a way to maybe...set the file to null and that erases it? Or should I try to open the file, erase it and set the offset to 0?
any tips would be nice