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;
    }
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;
    }
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 ; }
Reads the message from the passed stream and returns a PartBuilder
representing it.

@param StreamInterface $stream
@return PartBuilder
Reads the message from the passed stream and returns a PartBuilder representing it .