We are using Bytes.toBytes to write the int.  Consider using Bytes.toInt for the read.