rewrote methods to open and close all streams each time

wondows locks files while an input or output stream is open,
which is what was causing the issue for us before. i'd
completely forgotten about this "feature", so it took
me a while to figure out what the problem was.