public function getContentStream($transferEncoding, $fromCharset, $toCharset)
    {
        if ($this->stream === null) {
            return null;
        }
        if (empty($fromCharset) || empty($toCharset)) {
            return $this->getBinaryStream($transferEncoding);
        }
        if ($this->charsetStream === null
            || $this->isTransferEncodingFilterChanged($transferEncoding)
            || $this->isCharsetFilterChanged($fromCharset, $toCharset)) {
            if ($this->charsetStream === null
                || $this->isTransferEncodingFilterChanged($transferEncoding)) {
                $this->reset();
                $this->attachTransferEncodingFilter($transferEncoding);
            }
            $this->resetCharsetStream();
            $this->attachCharsetFilter($fromCharset, $toCharset);
        }
        $this->charsetStream->rewind();
        return $this->charsetStream;
    }
public function getContentStream($transferEncoding, $fromCharset, $toCharset)
    {
        if ($this->stream === null) {
            return null;
        }
        if (empty($fromCharset) || empty($toCharset)) {
            return $this->getBinaryStream($transferEncoding);
        }
        if ($this->charsetStream === null
            || $this->isTransferEncodingFilterChanged($transferEncoding)
            || $this->isCharsetFilterChanged($fromCharset, $toCharset)) {
            if ($this->charsetStream === null
                || $this->isTransferEncodingFilterChanged($transferEncoding)) {
                $this->reset();
                $this->attachTransferEncodingFilter($transferEncoding);
            }
            $this->resetCharsetStream();
            $this->attachCharsetFilter($fromCharset, $toCharset);
        }
        $this->charsetStream->rewind();
        return $this->charsetStream;
    }
public function getContentStream ( $ transferEncoding , $ fromCharset , $ toCharset ) { if ( $ this -> stream === null ) { return null ; } if ( empty ( $ fromCharset ) || empty ( $ toCharset ) ) { return $ this -> getBinaryStream ( $ transferEncoding ) ; } if ( $ this -> charsetStream === null || $ this -> isTransferEncodingFilterChanged ( $ transferEncoding ) || $ this -> isCharsetFilterChanged ( $ fromCharset , $ toCharset ) ) { if ( $ this -> charsetStream === null || $ this -> isTransferEncodingFilterChanged ( $ transferEncoding ) ) { $ this -> reset ( ) ; $ this -> attachTransferEncodingFilter ( $ transferEncoding ) ; } $ this -> resetCharsetStream ( ) ; $ this -> attachCharsetFilter ( $ fromCharset , $ toCharset ) ; } $ this -> charsetStream -> rewind ( ) ; return $ this -> charsetStream ; }
Checks what transfer-encoding decoder stream and charset conversion
stream are currently attached on the underlying stream, and resets them
if the requested arguments differ from the currently assigned ones.

@param string $transferEncoding
@param string $fromCharset the character set the content is encoded in
@param string $toCharset the target encoding to return
@return StreamInterface
Checks what transfer - encoding decoder stream and charset conversion stream are currently attached on the underlying stream and resets them if the requested arguments differ from the currently assigned ones .