This could be an infinite loop if `.read` reads zero bytes repeatedly; is this a concern?