GuzzleHttp\Psr7 stream decoder extension for charset conversion.
- author Zaahid Bateson
- Implements
Psr\Http\Message\StreamInterface Stringable - Traits
Methods |
public __call(string $method, array $args) Allow decorators to implement custom methods
|
public __construct(Psr\Http\Message\StreamInterface $stream, string $streamCharset = 'ISO-8859-1', string $stringCharset = 'UTF-8')
|
public __get(string $name) Magic method used to create a new stream if streams are not added in
|
public __toString() : string |
public close() : void |
public detach() |
public eof() : bool Returns true if the end of stream has been reached. |
public getContents() : string |
public getMetadata( $key = NULL)
|
public getSize() : ?int Returns null, getSize isn't supported
|
public isReadable() : bool |
public isSeekable() : bool Overridden to return false |
public isWritable() : bool |
public read( $length) : string Reads up to $length decoded chars from the underlying stream and returns
|
public rewind() : void |
public seek( $offset, $whence = 0ZBateson\StreamDecorators\SEEK_SET) : void Not supported.
|
public tell() : int Overridden to return the position in the target encoding. |
public write( $string) : int Writes the passed string to the underlying stream after converting it to
|
Properties |
protected $converter = NULL
|
protected $streamCharset = 'ISO-8859-1'
|
protected $stringCharset = 'UTF-8'
|
Methods |
protected createStream() : Psr\Http\Message\StreamInterface Implement in subclasses to dynamically create streams when requested.
|
Properties |
private $buffer = ''
|
private $bufferLength = 0
|
private $position = 0
|
private $stream = NULL
|
Methods |
private readRawCharsIntoBuffer(int $length) : void Reads a minimum of $length characters from the underlying stream in its Aligning to 4 bytes seemed to solve an issue reading from UTF-16LE |