I think you can use `int(nread)` here and avoid the extra copy