Removing redudant fileOutputStream.close