Writes data to a KeyCache using a stream.

package Swift
subpackage KeyCache
author Chris Corbyn

 Methods

Any implementation should be cloneable, allowing the clone to access a separate $nsKey and $itemKey.

__clone() 

Not used.

bind(\Swift_InputByteStream $is) 

The stream acts as an observer, receiving all data that is written. All write() and flushBuffers() operations will be mirrored.

Parameters

Not used.

commit() 

Exceptions

\Swift_IoException

Flush the contents of the stream (empty it) and set the internal pointer to the beginning.

flushBuffers() 

Exceptions

\Swift_IoException

Set the itemKey which will be written to.

setItemKey(string $itemKey) 

Parameters

$itemKey

string

Set the KeyCache to wrap.

setKeyCache(\Swift_KeyCache $keyCache) 

Parameters

$keyCache

\Swift_KeyCache

Set the nsKey which will be written to.

setNsKey(string $nsKey) 

Parameters

$nsKey

string

Specify a stream to write through for each write().

setWriteThroughStream(\Swift_InputByteStream $is) 

Parameters

Not used.

unbind(\Swift_InputByteStream $is) 

If $is is not bound, no errors will be raised. If the stream currently has any buffered data it will be written to $is before unbinding occurs.

Parameters

Writes $bytes to the end of the stream.

write(string $bytes, \Swift_InputByteStream $is) : int

Writing may not happen immediately if the stream chooses to buffer. If you want to write these bytes with immediate effect, call commit() after calling write().

This method returns the sequence ID of the write (i.e. 1 for first, 2 for second, etc etc).

Parameters

$bytes

string

$is

Exceptions

\Swift_IoException

Returns

int

 Properties

 

$_itemKey 
 

$_keyCache 
 

$_nsKey 
 

$_writeThrough