Added a rewind to write to reset the file pointer
Fixed writing test. Added test for new file.
Merge pull request #1 from ls12styler/master

`rewind` `File` pointer before writing data