Bencodex

StreamWriter
in package
implements Writer

A writer that put the given byte string into a stream, which usually refers to a file.

Interfaces, Classes, Traits and Enums

Writer
An interface to write a byte string (which can be quite long) in separated multiple chunks.

Table of Contents

__construct()  : void
Creates a new {@see StreamWriter} instance with the given handle.
getHandle()  : resource
Gets the pointer resource of the stream handle, which usually refers a file, to write bytes into.
write()  : void
Writes the given chunk of bytes.

Methods

__construct()

Creates a new {@see StreamWriter} instance with the given handle.

public __construct(resource $handle) : void
Parameters
$handle : resource

The pointer resource which refers a writable stream, usually a file.

Tags
throws
TypeError

Thrown when the given handle is not a resource.

Return values
void

getHandle()

Gets the pointer resource of the stream handle, which usually refers a file, to write bytes into.

public getHandle() : resource
Return values
resource

The handle resource which was configured using the constructor.

write()

Writes the given chunk of bytes.

public write(mixed $bytes) : void
Parameters
$bytes : mixed

The byte string to write. This is usually a chunk of a longer byte string.

Tags
inheritDoc
Return values
void

Search results