protected function read(StreamInterface $stream)
    {
        $partBuilder = $this->partBuilderFactory->newPartBuilder(
            $this->partFactoryService->getMessageFactory()
        );
        // the remaining parts use a resource handle for better performance...
        // it seems fgets does much better than Psr7\readline (not specifically
        // measured, but difference in running tests is big)
        $this->readPart(StreamWrapper::getResource($stream), $partBuilder);
        return $partBuilder;
    }