Interface Swift_InputByteStream

Implemented bySwift_ByteStream_AbstractFilterableInputStream, Swift_ByteStream_ArrayByteStream, Swift_ByteStream_FileByteStream, Swift_ByteStream_TemporaryFileByteStream, Swift_KeyCache_KeyCacheInputStream, Swift_Plugins_BandwidthMonitorPlugin, Swift_Plugins_ThrottlerPlugin, Swift_Signers_HeaderSigner, Swift_Transport_IoBuffer, Swift_Transport_StreamBuffer

An abstract means of writing data.

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

Public Methods

Hide inherited methods

MethodDescriptionDefined By
bind() Attach $is to this stream. Swift_InputByteStream
commit() For any bytes that are currently buffered inside the stream, force them off the buffer. Swift_InputByteStream
flushBuffers() Flush the contents of the stream (empty it) and set the internal pointer to the beginning. Swift_InputByteStream
unbind() Remove an already bound stream. Swift_InputByteStream
write() Writes $bytes to the end of the stream. Swift_InputByteStream

Method Details

bind() public abstract method

Attach $is to this stream.

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

public abstract void bind ( Swift_InputByteStream $is )
$is Swift_InputByteStream
commit() public abstract method

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

public abstract void commit ( )
throws Swift_IoException
flushBuffers() public abstract method

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

public abstract void flushBuffers ( )
throws Swift_IoException
unbind() public abstract method

Remove an already bound stream.

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.

public abstract void unbind ( Swift_InputByteStream $is )
$is Swift_InputByteStream
write() public abstract method

Writes $bytes to the end of the stream.

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

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

public abstract int write ( $bytes )
$bytes string
throws Swift_IoException