"The book was written by me" sounds more natural to me.



Scott