Add functs to read-fromBytes and convert toBytes