This content has been marked as final. Show 2 replies
951251 wrote:Nope, but the bug is not closed - just ignored for all eternity. Nobody but you seems to care about it.
Is there a way to re-open a bug (without submitting a new one) ?
A work-around for this incredibly odd issue seems to be to simple delete an existing file before you attempt to write a new one.
I've found what the proposed solution is about.
Instead of creating the FileImageOutputStream from a File, it needs to be created from a RandomAccessFile.
This way, it is possible to reset the length of the RandomAccessFile to 0.
Or we can truncate the RandomAccessFile before closing the FileImageOutputStream (which seems a bit more efficient).
RandomAccessFile raf = new RandomAccessFile(this.dst, "rw"); raf.setLength(0); FileImageOutputStream imgOutStrm = new FileImageOutputStream(raf);
A bit complicated for someone who just want to write an image to a file.