read's function signature says it takes a size_t, so I just cast it to be sure we don't get a compiler warning. If it doesn't matter I can remove that. (I'm not seeing a warning when I remove it)