The sender's network stack assembles tcp packets without regard for write boundaries, so the receiver has to be prepared for partial reads.