DecompressingWritableStream
in package
implements
WritableStream
uses
ForbidCloning, ForbidSerialization
Allows decompression of output streams using Zlib.
Table of Contents
Interfaces
- WritableStream
- A `WritableStream` allows writing data in chunks. Writers can wait on the returned promises to feel the backpressure.
Properties
- $destination : WritableStream
- $encoding : int
- $inflateContext : InflateContext|null
- $options : array<string|int, mixed>
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- close() : void
- Closes the resource, marking it as unusable.
- end() : void
- Marks the stream as no longer writable.
- getEncoding() : int
- Gets the used compression encoding.
- getOptions() : array<string|int, mixed>
- Gets the used compression options.
- isClosed() : bool
- Returns whether this resource has been closed.
- isWritable() : bool
- onClose() : void
- Registers a callback that is invoked when this resource is closed.
- write() : void
- Writes data to the stream.
- __clone() : mixed
Properties
$destination read-only
private
WritableStream
$destination
$encoding read-only
private
int
$encoding
$inflateContext
private
InflateContext|null
$inflateContext
$options read-only
private
array<string|int, mixed>
$options
= []
Methods
__construct()
public
__construct(WritableStream $destination, int $encoding[, array<string|int, mixed> $options = [] ]) : mixed
Parameters
- $destination : WritableStream
-
Output stream to write the decompressed data to.
- $encoding : int
-
Compression encoding to use, see
inflate_init(). - $options : array<string|int, mixed> = []
-
Compression options to use, see
inflate_init().
Tags
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverclose()
Closes the resource, marking it as unusable.
public
close() : void
Whether pending operations are aborted or not is implementation dependent.
end()
Marks the stream as no longer writable.
public
end() : void
Note that this is not the same as forcefully closing the stream. This method waits for all pending writes to complete before closing the stream. Socket streams implementing this interface should only close the writable side of the stream.
getEncoding()
Gets the used compression encoding.
public
getEncoding() : int
Return values
int —Encoding specified on construction time.
getOptions()
Gets the used compression options.
public
getOptions() : array<string|int, mixed>
Return values
array<string|int, mixed> —Options array passed on construction time.
isClosed()
Returns whether this resource has been closed.
public
isClosed() : bool
Return values
bool —true if closed, otherwise false.
isWritable()
public
isWritable() : bool
Return values
bool —A stream may no longer be writable if it is closed or ended using end().
onClose()
Registers a callback that is invoked when this resource is closed.
public
onClose(Closure $onClose) : void
Parameters
- $onClose : Closure
write()
Writes data to the stream.
public
write(string $bytes) : void
Parameters
- $bytes : string
-
Bytes to write.
__clone()
protected
final __clone() : mixed