Writes data to a KeyCache using a stream.

Classes implementing this interface may use a subsystem which requires less memory than working with large strings of data.

package Swift
subpackage KeyCache
author Chris Corbyn

 Methods

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

__clone() 

Attach $is to this stream.

bind(\Swift_InputByteStream $is) 
Inherited

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

inherited_from \Swift_InputByteStream::bind()

Parameters

For any bytes that are currently buffered inside the stream, force them off the buffer.

commit() 
Inherited
inherited_from \Swift_InputByteStream::commit()

Exceptions

\Swift_IoException

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

flushBuffers() 
Inherited
inherited_from \Swift_InputByteStream::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

Remove an already bound stream.

unbind(\Swift_InputByteStream $is) 
Inherited

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.

inherited_from \Swift_InputByteStream::unbind()

Parameters

Writes $bytes to the end of the stream.

write(string $bytes) : int
Inherited

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).

inherited_from \Swift_InputByteStream::write()

Parameters

$bytes

string

Exceptions

\Swift_IoException

Returns

int