Sgss_File_Reader_Abstract 
Abstract class for reading bytes from stream

Description

Implements:
Sgss_File_Reader_Interface
Author:
Matsuda Shota
Copyright:
(c) 2007-2008 Matsuda Shota
License:
http://creativecommons.org/licenses/GPL/2.0/
Located in:
/File/Reader/Abstract.php (line 51)

Direct descendants

Sgss_File_Reader_Filter_Abstract Abstract class of the wrapper for the classes implementing Sgss_File_Reader_Interface
Sgss_File_Reader_String Reads bytes from string
Sgss_File_Reader Reads bytes from the Sgss_File_Stream_Read object

Class overview

Variables

protected int $_position

Current pointer position of the stream in byte

protected int $_size

Size of the stream in byte

Methods

Sgss_File_Reader_Filter_Abstract filter (string $filter, [string|null $namespace = null])

Returns the filtered reader specified by the parameters

int move (int $position)

Moves the pointer of the stream to the specified position in byte without reading the contents

int position ()

Returns the current pointer position of the stream in byte

int size ()

Returns the size of the stream in byte

int skip (int $length)

Moves the pointer of the stream by the specified length of bytes without reading the contents

Variable detail

$_position 

Current pointer position of the stream in byte

Signature:
protected int $_position = 0


$_size 

Size of the stream in byte

Signature:
protected int $_size = 0


Method detail

filter

Returns the filtered reader specified by the parameters

Parameters:
  • string $filter

    Filter class name

  • string|null $namespace

    Filter class namespace

Returns:
Sgss_File_Reader_Filter_Abstract -- Filtered reader by which this reader is contained
Throws:
  • Sgss_File_Reader_Exception

    When the specified filter reader is illegal or does not exists

Specified by:
Uses:
Sgss_File_Reader_Filter_Abstract, Zend_Loader
Related subject:
Sgss_File_Reader_Interface::filter()
Signature:
public Sgss_File_Reader_Filter_Abstract filter (string $filter, [string|null $namespace = null])


move

Moves the pointer of the stream to the specified position in byte without reading the contents

Parameters:
  • int $position

    Position in byte to which the pointer moves

Returns:
int -- Offset length in byte, from the previous position to the position after this operation
Throws:
  • Sgss_File_Reader_Exception

    When attempting to move the pointer position below the beggining of the stream, or beyond the end of stream

Specified by:
Overridden by:
Used by:
Sgss_File_Reader_Abstract::skip(), Sgss_File_Reader::move(), Sgss_File_Reader_Filter_Abstract::move(), Sgss_File_Reader_String::reset()
Related subject:
Sgss_File_Reader_Interface::move()
Signature:
public int move (int $position)


position

Returns the current pointer position of the stream in byte

Returns:
int -- Current pointer position of the stream in byte
Specified by:
Overridden by:
Used by:
Sgss_File_Reader_Filter_Abstract::position()
Related subject:
Sgss_File_Reader_Interface::position()
Signature:
public int position ()


size

Returns the size of the stream in byte

Returns:
int -- Size of the stream in byte
Specified by:
Overridden by:
Used by:
Sgss_File_Reader_Filter_Abstract::size()
Related subject:
Sgss_File_Reader_Interface::size()
Signature:
public int size ()


skip

Moves the pointer of the stream by the specified length of bytes without reading the contents

Parameters:
  • int $length

    Length in byte by which the pointer moves

Returns:
int -- Offset length in byte, from the previous position to the position after this operation
Specified by:
Overridden by:
Uses:
Sgss_File_Reader_Abstract::move()
Used by:
Sgss_File_Reader_Filter_Abstract::skip()
Related subject:
Sgss_File_Reader_Interface::skip()
Signature:
public int skip (int $length)