# OutputStream Class Reference
[Various accompanying utilities]

Inheritance diagram for OutputStream:
[legend]

List of all members.

## Public Member Functions

| write ($buffer)
| MUST send either whole buffer or nothing at all or throw IOException.
| flush ()
| close ()

## Detailed Description

Definition at line 15 of file OutputStream.class.php.

## Member Function Documentation

OutputStream::close | ( |  | ) |

Returns:
  OutputStream

Reimplemented in FileOutputStream.

Definition at line 45 of file OutputStream.class.php.

OutputStream::flush | ( |  | ) |

Returns:
  OutputStream

Definition at line 35 of file OutputStream.class.php.

OutputStream::write | ( | $ | buffer | ) | `[abstract]`

MUST send either whole buffer or nothing at all or throw IOException.

NOTE: if buffer is too large to send it at once and first chunk of data has been sent successfully, it MUST BLOCK until all data is sent, or throw IOException. In this case it MUST NOT throw IOTimedOutException due to impossibility of detecting what data has been already sent.

It is abnormal state. Maybe you should use some kind of non-blocking channels instead?

Reimplemented in FileOutputStream, and SocketOutputStream.

The documentation for this class was generated from the following file:

- main/Utils/IO/OutputStream.class.php