Refactoring XChunkSocketStream::read