Class Swift_ByteStream_FileByteStream
Allows reading and writing of bytes to and from a file.
Protected Properties
Property | Type | Description | Defined By |
---|---|---|---|
$_sequence | Write sequence. | Swift_ByteStream_AbstractFilterableInputStream |
Public Methods
Method | Description | Defined 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
Method | Description | Defined By |
---|---|---|
_commit() | Just write the bytes to the file | Swift_ByteStream_FileByteStream |
_flush() | Not used | Swift_ByteStream_FileByteStream |
Method Details
Create a new FileByteStream for $path.
public void __construct ( $path, $writable = false ) | ||
$path | string | |
$writable | bool | If true |
Just write the bytes to the file
protected void _commit ( $bytes ) | ||
$bytes |
Not used
protected void _flush ( ) |
Get the complete path to the file.
public string getPath ( ) |
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 |
---|
Move the internal read pointer to $byteOffset in the stream.
public bool setReadPointer ( $byteOffset ) | ||
$byteOffset | int |