The former does not guarantee the whole buffer is written; instead it returns how many bytes were written and expects the caller to try again