it looks like we could have a utility method to validate buffer, off and len together