Overview

Namespaces

  • Webmozart
    • Console
      • Adapter
      • Api
        • Application
        • Args
          • Format
        • Command
        • Config
        • Event
        • Formatter
        • IO
        • Resolver
      • Args
      • Config
      • Formatter
      • Handler
        • Help
      • IO
        • InputStream
        • OutputStream
      • Process
      • Resolver
      • UI
        • Alignment
        • Component
        • Help
        • Layout
        • Style
      • Util

Classes

  • NullInputStream
  • StandardInputStream
  • StreamInputStream
  • StringInputStream
  • Overview
  • Namespace
  • Class

Class StreamInputStream

An input stream that reads from a PHP stream.

Webmozart\Console\IO\InputStream\StreamInputStream implements Webmozart\Console\Api\IO\InputStream

Direct known subclasses

Webmozart\Console\IO\InputStream\StandardInputStream, Webmozart\Console\IO\InputStream\StringInputStream
Namespace: Webmozart\Console\IO\InputStream
Author: Bernhard Schussek bschussek@gmail.com
Since: 1.0
Located at IO/InputStream/StreamInputStream.php
Methods summary
public
# __construct( resource $stream )

Creates the input.

Creates the input.

Parameters

$stream
A stream resource.
public string
# read( integer $length )

Reads the given amount of characters from the stream.

Reads the given amount of characters from the stream.

Parameters

$length
The number of characters to read.

Returns

string
The characters read from the stream.

Throws

Webmozart\Console\Api\IO\IOException
If reading fails or if the stream is closed.

Implementation of

Webmozart\Console\Api\IO\InputStream::read()
public string
# readLine( integer $length = null )

Reads a line from the stream.

Reads a line from the stream.

Parameters

$length

The maximum number of characters to read. If null, all characters up to the first newline are returned.

Returns

string
The characters read from the stream.

Throws

Webmozart\Console\Api\IO\IOException
If reading fails or if the stream is closed.

Implementation of

Webmozart\Console\Api\IO\InputStream::readLine()
public
# close( )

Closes the stream.

Closes the stream.

Implementation of

Webmozart\Console\Api\IO\InputStream::close()
public boolean
# isClosed( )

Returns whether the stream is closed.

Returns whether the stream is closed.

Returns

boolean
Returns true if the stream is closed.

Implementation of

Webmozart\Console\Api\IO\InputStream::isClosed()
Webmozart Console API API documentation generated by ApiGen