TemporaryFileByteStream
extends FileByteStream
in package
Temporary file byte stream class
Tags
Table of Contents
Properties
- $sequence : int
- Write sequence
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
- Just write the bytes to the file
- flush() : void
- Not used
Properties
$sequence
Write sequence
protected
int
$sequence
= 0
Methods
__construct()
Create a new TemporaryFileByteStream
public
__construct() : mixed
Tags
__destruct()
Destructor
public
__destruct() : mixed
addFilter()
Add a StreamFilter to this InputByteStream
public
addFilter(FilterInterface $filter, string $key) : void
Parameters
- $filter : FilterInterface
- $key : string
bind()
Attach $is to this stream.
public
bind(InputInterface $is) : void
The stream acts as an observer, receiving all data that is written. All and operations will be mirrored.
Parameters
- $is : InputInterface
commit()
For any bytes that are currently buffered inside the stream, force them off the buffer
public
commit() : void
flushBuffers()
Flush the contents of the stream (empty it) and set the internal pointer to the beginning.
public
flushBuffers() : void
getContent()
Get content
public
getContent() : string
Tags
Return values
stringgetPath()
Get the complete path to the file
public
getPath() : string
Return values
stringread()
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
Return values
string|boolremoveFilter()
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
unbind()
Remove an already bound stream.
public
unbind(InputInterface $is) : void
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.
Parameters
- $is : InputInterface
write()
Writes $bytes to the end of the stream
public
write(string $bytes) : mixed
Parameters
- $bytes : string
commitBytes()
Just write the bytes to the file
protected
commitBytes(string $bytes) : int
Parameters
- $bytes : string
Return values
intflush()
Not used
protected
flush() : void