convertToBytes now returns number of bytes as an integer