19 use StreamDecoratorTrait;
29 stream_filter_append($resource,
'zlib.inflate', STREAM_FILTER_READ);
30 $this->stream =
new Stream($resource);
40 $filename_header_length = 0;
42 if (substr(bin2hex(
$header), 6, 2) ===
'08') {
44 $filename_header_length = 1;
45 while (
$stream->read(1) !== chr(0)) {
46 $filename_header_length++;
50 return $filename_header_length;
An exception for terminatinating execution or to throw for unit testing.
Uses PHP's zlib.inflate filter to inflate deflate or gzipped content.
__construct(StreamInterface $stream)
getLengthOfPossibleFilenameHeader(StreamInterface $stream, $header)
Decorator used to return only a subset of a stream.
static getResource(StreamInterface $stream)
Returns a resource representing the stream.
$stream
PHP stream implementation.