Making Message class able to read and write