Documentation

TemporaryFileByteStream extends FileByteStream
in package

Temporary file byte stream class

Tags
category

Pop

author

Romain-Geissler from the SwiftMailer library https://github.com/swiftmailer/swiftmailer

version
4.0.0

Table of Contents

Properties

$sequence  : int
Write sequence
$filters  : array<string|int, mixed>
StreamFilters
$mirrors  : array<string|int, mixed>
Bound streams
$mode  : string
The mode this file is opened in for writing
$offset  : int
The internal pointer offset
$path  : string
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  : string
A buffer for writing
$writer  : mixed
A lazy-loaded resource handle for writing the file

Methods

__construct()  : mixed
Create a new TemporaryFileByteStream
__destruct()  : mixed
Destructor
addFilter()  : void
Add a StreamFilter to this InputByteStream
bind()  : void
Attach $is to this stream.
commit()  : void
For any bytes that are currently buffered inside the stream, force them off the buffer
flushBuffers()  : void
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
getContent()  : string
Get content
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()  : void
Remove an already present StreamFilter based on its $key
setReadPointer()  : void
Move the internal read pointer to $byteOffset in the stream
unbind()  : void
Remove an already bound stream.
write()  : mixed
Writes $bytes to the end of the stream
commitBytes()  : int
Commit the given bytes to the storage medium immediately
flush()  : void
Flush any buffers/content with immediate effect
copyReadStream()  : void
Copy a readOnly Stream to ensure seekability
doWrite()  : void
Just write the bytes to the stream
filter()  : mixed
Run $bytes through all filters
getReadHandle()  : mixed
Get the resource for reading
getReadStreamSeekableStatus()  : void
Check if ReadOnly Stream is seekable
getWriteHandle()  : mixed
Get the resource for writing
resetReadHandle()  : void
Force a reload of the resource for reading
seekReadStreamToPosition()  : void
Streams in a readOnly stream ensuring copy if needed

Properties

$mode

The mode this file is opened in for writing

private string $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 = null

$writer

A lazy-loaded resource handle for writing the file

private mixed $writer

Methods

flushBuffers()

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

public flushBuffers() : void

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|string $length) : string|bool

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

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

removeFilter()

Remove an already present StreamFilter based on its $key

public removeFilter(string $key) : void
Parameters
$key : string

setReadPointer()

Move the internal read pointer to $byteOffset in the stream

public setReadPointer(int|string $byteOffset) : void
Parameters
$byteOffset : int|string

commitBytes()

Commit the given bytes to the storage medium immediately

protected abstract commitBytes(string $bytes) : int
Parameters
$bytes : string
Return values
int

copyReadStream()

Copy a readOnly Stream to ensure seekability

private copyReadStream() : void

getReadStreamSeekableStatus()

Check if ReadOnly Stream is seekable

private getReadStreamSeekableStatus() : void

resetReadHandle()

Force a reload of the resource for reading

private resetReadHandle() : void

seekReadStreamToPosition()

Streams in a readOnly stream ensuring copy if needed

private seekReadStreamToPosition(int|string $offset) : void
Parameters
$offset : int|string

        
On this page

Search results