SetaPDF_Core_Writer_TempStream A writer class for temporary streams

File: /SetaPDF v2/Core/Writer/TempStream.php

Class hierarchy

Implements

Summary

Properties

$_buffer

$_bufferSize

$_handle

The file stream resource

$_status

Status property


Methods

__construct()

public SetaPDF_Core_Writer_TempStream::__construct (
[ null|int $memoryLimit = null [, int $bufferSize = 10000 ]]
)

The constructor.

Parameters
$memoryLimit : null|int

Limit to use before writing to a temporary file. If null PHPs default (2 MB) is used.

$bufferSize : int

The buffer size of which needs to be reached until the data is written to the stream.

__destruct()

The deconstructor closes the file handle.

_flush()

protected SetaPDF_Core_Writer_TempStream::_flush (
void
): void

Flushes the buffer to the stream and resets the buffer.

_setHandle()

protected SetaPDF_Core_Writer_Stream::_setHandle (
resource $handle
): void

Set the stream handle.

Parameters
$handle : resource
 

cleanUp()

Method which should/will be called when the document objects cleanUp() method is called.

copy()

Copies an existing stream into the target stream.

Parameters
$source : resource|SetaPDF_Core_Writer_Stream
 

finish()

public SetaPDF_Core_Writer_TempStream::finish (
void
): void

Finish methods flushes the buffer to the stream.

getHandle()

public SetaPDF_Core_Writer_TempStream::getHandle (
void
): resource

Gets the handle of the stream.

This method is overwritten to ensure that the handle is only accessed when the writer instance has the status "finished".

getPos()

public SetaPDF_Core_Writer_TempStream::getPos (
void
): integer

Returns the current position.

getStatus()

Get the current status of the writer object.

start()

Method which should/will be called when the writing process starts.

write()

public SetaPDF_Core_Writer_TempStream::write (
string $s
): void

Write content to the stream or buffer.

Parameters
$s : string