* Stores the result in *val and returns the number of input bytes read (or 0
* if the input is invalid, in which case *val is undefined).
*/
* Stores the result in *val and returns the number of input bytes read (or 0
* if the input is invalid, in which case *val is undefined).
*/