Documentation

Swift_ByteStream_TemporaryFileByteStream extends Swift_ByteStream_FileByteStream
in package

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

Tags
author

Romain-Geissler

Table of Contents

$sequence  : mixed
Write sequence.
$filters  : array<string|int, Swift_StreamFilter>
StreamFilters.
$mirrors  : array<string|int, Swift_InputByteStream>
Bound streams.
$mode  : mixed
The mode this file is opened in for writing
$offset  : mixed
The internal pointer offset
$path  : mixed
The path to the file
$reader  : mixed
A lazy-loaded resource handle for reading the file
$seekable  : mixed
If stream is seekable true/false, or null if not known
$writeBuffer  : mixed
A buffer for writing.
$writer  : mixed
A lazy-loaded resource handle for writing the file
__construct()  : mixed
Create a new FileByteStream for $path.
__destruct()  : mixed
addFilter()  : mixed
Add a StreamFilter to this InputByteStream.
bind()  : mixed
Attach $is to this stream.
commit()  : mixed
For any bytes that are currently buffered inside the stream, force them off the buffer.
flushBuffers()  : mixed
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
getContent()  : mixed
getPath()  : string
Get the complete path to the file.
read()  : string|bool
Reads $length bytes from the stream into a string and moves the pointer through the stream by $length.
removeFilter()  : mixed
Remove an already present StreamFilter based on its $key.
setReadPointer()  : bool
Move the internal read pointer to $byteOffset in the stream.
unbind()  : mixed
Remove an already bound stream.
write()  : int
Writes $bytes to the end of the stream.
doCommit()  : mixed
Commit the given bytes to the storage medium immediately.
flush()  : mixed
Flush any buffers/content with immediate effect.
copyReadStream()  : mixed
Copy a readOnly Stream to ensure seekability
doWrite()  : mixed
Just write the bytes to the stream
filter()  : mixed
Run $bytes through all filters
getReadHandle()  : mixed
Get the resource for reading
getReadStreamSeekableStatus()  : mixed
Check if ReadOnly Stream is seekable
getWriteHandle()  : mixed
Get the resource for writing
resetReadHandle()  : mixed
Force a reload of the resource for reading
seekReadStreamToPosition()  : mixed
Streams in a readOnly stream ensuring copy if needed

Properties

$mode

The mode this file is opened in for writing

private mixed $mode

$reader

A lazy-loaded resource handle for reading the file

private mixed $reader

$seekable

If stream is seekable true/false, or null if not known

private mixed $seekable = ull

$writer

A lazy-loaded resource handle for writing the file

private mixed $writer

Methods

__construct()

Create a new FileByteStream for $path.

public __construct() : mixed
Return values
mixed

getPath()

Get the complete path to the file.

public getPath() : string
Return values
string

read()

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

public read(int $length) : string|bool

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

Parameters
$length : int
Tags
throws
Swift_IoException
Return values
string|bool

removeFilter()

Remove an already present StreamFilter based on its $key.

public removeFilter(string $key) : mixed
Parameters
$key : string
Return values
mixed

setReadPointer()

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

public setReadPointer(int $byteOffset) : bool
Parameters
$byteOffset : int
Return values
bool

doCommit()

Commit the given bytes to the storage medium immediately.

protected abstract doCommit(string $bytes) : mixed
Parameters
$bytes : string
Return values
mixed

copyReadStream()

Copy a readOnly Stream to ensure seekability

private copyReadStream() : mixed
Return values
mixed

doWrite()

Just write the bytes to the stream

private doWrite(mixed $bytes) : mixed
Parameters
$bytes : mixed
Return values
mixed

filter()

Run $bytes through all filters

private filter(mixed $bytes) : mixed
Parameters
$bytes : mixed
Return values
mixed

getReadHandle()

Get the resource for reading

private getReadHandle() : mixed
Return values
mixed

getReadStreamSeekableStatus()

Check if ReadOnly Stream is seekable

private getReadStreamSeekableStatus() : mixed
Return values
mixed

getWriteHandle()

Get the resource for writing

private getWriteHandle() : mixed
Return values
mixed

resetReadHandle()

Force a reload of the resource for reading

private resetReadHandle() : mixed
Return values
mixed

seekReadStreamToPosition()

Streams in a readOnly stream ensuring copy if needed

private seekReadStreamToPosition(mixed $offset) : mixed
Parameters
$offset : mixed
Return values
mixed

Search results