Provides a readable stream for a MessagePart.

author Zaahid Bateson
package MailMimeParser

 Methods

Constructor

__construct(\ZBateson\MailMimeParser\Stream\StreamFactory $sdf, \ZBateson\MailMimeParser\Message\Part\MessagePart $part) 

Parameters

$sdf

\ZBateson\MailMimeParser\Stream\StreamFactory

$part

\ZBateson\MailMimeParser\Message\Part\MessagePart

Creates the underlying stream lazily when required.

createStream() : \Psr\Http\Message\StreamInterface

Returns

\Psr\Http\Message\StreamInterface

Creates an array of streams based on the attached part's mime boundary and child streams.

getBoundaryAndChildStreams(\ZBateson\MailMimeParser\Message\Part\ParentHeaderPart $part) : array<mixed,\Psr\Http\Message\StreamInterface>

Parameters

$part

\ZBateson\MailMimeParser\Message\Part\ParentHeaderPart

passed in because $this->part is declared as MessagePart

Returns

array<mixed,\Psr\Http\Message\StreamInterface>

Returns an array of Psr7 Streams representing the attached part and it's direct children.

getStreamsArray() : array<mixed,\Psr\Http\Message\StreamInterface>

Returns

array<mixed,\Psr\Http\Message\StreamInterface>

Attaches and returns a CharsetStream decorator to the passed $stream.

getCharsetDecoratorForStream(\Psr\Http\Message\StreamInterface $stream) : \Psr\Http\Message\StreamInterface

If the current attached MessagePart doesn't specify a charset, $stream is returned as-is.

Parameters

$stream

\Psr\Http\Message\StreamInterface

Returns

\Psr\Http\Message\StreamInterface

Attaches and returns a transfer encoding stream decorator to the passed $stream.

getTransferEncodingDecoratorForStream(\Psr\Http\Message\StreamInterface $stream) : \Psr\Http\Message\StreamInterface

The attached stream decorator is based on the attached part's returned value from MessagePart::getContentTransferEncoding, using one of the following stream decorators as appropriate:

o QuotedPrintableStream o Base64Stream o UUStream

Parameters

$stream

\Psr\Http\Message\StreamInterface

Returns

\Psr\Http\Message\StreamInterface

Writes out the content portion of the attached mime part to the passed $stream.

writePartContentTo(\Psr\Http\Message\StreamInterface $stream) 

Parameters

$stream

\Psr\Http\Message\StreamInterface

 Properties

 

The part to read from.

$part : \ZBateson\MailMimeParser\Message\Part\MessagePart

Default

 

For creating needed stream decorators.

$streamFactory : \ZBateson\MailMimeParser\Stream\StreamFactory

Default