Holds the stream and content stream objects for a part.
Note that streams are not explicitly closed or detached on destruction of the
PartSreamContainer by design: the passed StreamInterfaces will be closed on
their destruction when no references to them remain, which is useful when the
streams are passed around.
In addition, all the streams passed to PartStreamContainer should be wrapping
a ZBateson\StreamDecorators\NonClosingStream unless attached to a part by a
user, this is because MMP uses a single seekable stream for content and wraps
it in ZBateson\StreamDecorators\SeekingLimitStream objects for each part.
- author Zaahid Bateson
Methods |
public __construct(ZBateson |
public getBinaryContentStream(?string $transferEncoding = NULL) : ?Psr\Http\Message\StreamInterface Checks what transfer-encoding decoder stream is attached on the
|
public getContentStream(?string $transferEncoding, ?string $fromCharset, ?string $toCharset) Checks what transfer-encoding decoder stream and charset conversion
|
public getStream() Returns the part's stream containing the part's headers, content, and
|
public hasContent() : bool Returns true if there's a content stream associated with the part. |
public reset() Resets cached encoding and charset streams, and rewinds the stream. |
public setContentStream(?Psr\Http\Message\StreamInterface $contentStream = NULL) Attaches the passed stream as the content portion of this The content stream would represent the content portion of $this->stream. If the content is overridden, $this->stream should point to a dynamic setContentStream can be called with 'null' to indicate the IMessagePart
|
public setStream(Psr\Http\Message\StreamInterface $stream) Sets the part's stream containing the part's headers, content, and |
Properties |
protected $charsetStream = NULL
|
protected $contentStream = NULL
|
protected $decodedStream = NULL
|
protected $detachParsedStream = NULL
|
protected $stream = NULL
|
protected $streamFactory = NULL
|
Methods |
protected attachCharsetFilter(string $fromCharset, string $toCharset) : self Attaches a charset conversion filter to the attached content handle, for
|
protected attachTransferEncodingFilter(?string $transferEncoding) : self Attaches a decoding filter to the attached content handle, for the passed
|
Properties |
private $charset = ['from' => NULL, 'to' => NULL, 'filter' => NULL]
|
private $encoding = ['type' => NULL, 'filter' => NULL]
|
Methods |
private isCharsetFilterChanged(string $fromCharset, string $toCharset) : bool Returns true if the attached stream filter used for charset conversion on |
private isTransferEncodingFilterChanged(?string $transferEncoding) : bool Returns true if the attached stream filter used for decoding the content
|
private resetCharsetStream() : self Resets just the charset stream, and rewinds the decodedStream. |