Class Swift_ByteStream_FileByteStream

InheritanceSwift_ByteStream_FileByteStream » Swift_ByteStream_AbstractFilterableInputStream
ImplementsSwift_FileStream, Swift_Filterable, Swift_InputByteStream
SubclassesSwift_ByteStream_TemporaryFileByteStream

Allows reading and writing of bytes to and from a file.

Protected Properties

Hide inherited properties

PropertyTypeDescriptionDefined By
$_sequence Write sequence. Swift_ByteStream_AbstractFilterableInputStream

Public Methods

Hide inherited methods

MethodDescriptionDefined By
__construct() Create a new FileByteStream for $path. Swift_ByteStream_FileByteStream
addFilter() Add a StreamFilter to this InputByteStream. Swift_ByteStream_AbstractFilterableInputStream
bind() Attach $is to this stream. Swift_ByteStream_AbstractFilterableInputStream
commit() For any bytes that are currently buffered inside the stream, force them off the buffer. Swift_ByteStream_AbstractFilterableInputStream
flushBuffers() Flush the contents of the stream (empty it) and set the internal pointer to the beginning. Swift_ByteStream_AbstractFilterableInputStream
getPath() Get the complete path to the file. Swift_ByteStream_FileByteStream
read() Reads $length bytes from the stream into a string and moves the pointer through the stream by $length. Swift_ByteStream_FileByteStream
removeFilter() Remove an already present StreamFilter based on its $key. Swift_ByteStream_AbstractFilterableInputStream
setReadPointer() Move the internal read pointer to $byteOffset in the stream. Swift_ByteStream_FileByteStream
unbind() Remove an already bound stream. Swift_ByteStream_AbstractFilterableInputStream
write() Writes $bytes to the end of the stream. Swift_ByteStream_AbstractFilterableInputStream

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
_commit() Just write the bytes to the file Swift_ByteStream_FileByteStream
_flush() Not used Swift_ByteStream_FileByteStream

Method Details

__construct() public method

Create a new FileByteStream for $path.

public void __construct ( $path, $writable false )
$path string
$writable bool

If true

_commit() protected method

Just write the bytes to the file

protected void _commit ( $bytes )
$bytes
_flush() protected method

Not used

protected void _flush ( )
getPath() public method

Get the complete path to the file.

public string getPath ( )
read() public method

Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.

If less bytes exist than are requested the remaining bytes are given instead. If no bytes are remaining at all, boolean false is returned.

public string|bool read ( $length )
$length int
throws Swift_IoException
setReadPointer() public method

Move the internal read pointer to $byteOffset in the stream.

public bool setReadPointer ( $byteOffset )
$byteOffset int