class Codec implements CodecInterface
A general-purpose codec implementation for composing custom codecs.
Methods
__construct(TransformInterface $encodeTransform, TransformInterface $decodeTransform)
Construct a new codec. |
||
TransformInterface |
encodeTransform()
Get the encode transform. |
|
TransformInterface |
decodeTransform()
Get the decode transform. |
|
string |
encode(string $data)
Encode the supplied data. |
|
string |
decode(string $data)
Decode the supplied data. |
|
TransformStreamInterface |
createEncodeStream(integer|null $bufferSize = null)
Create a new encode stream. |
|
TransformStreamInterface |
createDecodeStream(integer|null $bufferSize = null)
Create a new decode stream. |
Details
at line 29
public
__construct(TransformInterface $encodeTransform, TransformInterface $decodeTransform)
Construct a new codec.
at line 42
public TransformInterface
encodeTransform()
Get the encode transform.
at line 52
public TransformInterface
decodeTransform()
Get the decode transform.
at line 65
public string
encode(string $data)
Encode the supplied data.
at line 85
public string
decode(string $data)
Decode the supplied data.
at line 104
public TransformStreamInterface
createEncodeStream(integer|null $bufferSize = null)
Create a new encode stream.
at line 116
public TransformStreamInterface
createDecodeStream(integer|null $bufferSize = null)
Create a new decode stream.