eloquent/confetti API
Class

Eloquent\Confetti\TransformStream

class TransformStream extends EventEmitter implements TransformStreamInterface

A stream that applies a transform.

Methods

__construct(TransformInterface $transform, integer|null $bufferSize = null)

Construct a new data transform stream.

TransformInterface transform()

Get the transform.

integer bufferSize()

Get the buffer size.

boolean isWritable()

Returns true if this stream is writable.

boolean isReadable()

Returns true if this stream is readable.

boolean write(string $data)

Write some data to be transformed.

end(string|null $data = null)

Transform and finalize any remaining buffered data.

close()

Close this stream.

pause()

Pause this stream.

resume()

Resume this stream.

WritableStreamInterface pipe(WritableStreamInterface $destination, array $options = array())

Pipe the output of this stream to another stream.

Details

at line 29
public __construct(TransformInterface $transform, integer|null $bufferSize = null)

Construct a new data transform stream.

Parameters

TransformInterface $transform The data transform to use.
integer|null $bufferSize The buffer size in bytes.

at line 55
public TransformInterface transform()

Get the transform.

Return Value

TransformInterface The transform.

at line 65
public integer bufferSize()

Get the buffer size.

Return Value

integer The buffer size in bytes.

at line 75
public boolean isWritable()

Returns true if this stream is writable.

Return Value

boolean True if writable.

at line 85
public boolean isReadable()

Returns true if this stream is readable.

Return Value

boolean True if readable.

at line 97
public boolean write(string $data)

Write some data to be transformed.

Parameters

string $data The data to transform.

Return Value

boolean True if this stream is ready for more data.

at line 119
public end(string|null $data = null)

Transform and finalize any remaining buffered data.

Parameters

string|null $data Additional data to transform before finalizing.

at line 136
public close()

Close this stream.

at line 148
public pause()

Pause this stream.

at line 156
public resume()

Resume this stream.

at line 170
public WritableStreamInterface pipe(WritableStreamInterface $destination, array $options = array())

Pipe the output of this stream to another stream.

Parameters

WritableStreamInterface $destination The destination stream.
array $options A set of options for the piping process.

Return Value

WritableStreamInterface The destination stream.