add support for options and not truncating offset for IO.write
Merge pull request #764 from josedonizetti/io_write

add support for options and not truncating offset for IO.write