why return int?  you can return true or false if you want to tell if the writing succeeded or failed.