Reader.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2007 by Dmitry A. Lomash                                *
00004  *                                                                         *
00005  *   This program is free software; you can redistribute it and/or modify  *
00006  *   it under the terms of the GNU Lesser General Public License as        *
00007  *   published by the Free Software Foundation; either version 3 of the    *
00008  *   License, or (at your option) any later version.                       *
00009  *                                                                         *
00010  ***************************************************************************/
00011 /* $Id: Reader.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00016     abstract class Reader
00017     {
00018         const BLOCK_SIZE = 16384;
00019         
00020         abstract public function close();
00021         abstract public function read($count);
00022         
00023         public function isEof()
00024         {
00025             return false;
00026         }
00027         
00028         public function mark()
00029         {
00030             throw new IOException('mark() not supported');
00031         }
00032         
00033         public function markSupported()
00034         {
00035             return false;
00036         }
00037         
00038         public function reset()
00039         {
00040             throw new IOException('reset() not supported');
00041         }
00042         
00043         public function skip($count)
00044         {
00045             return mb_strlen($this->read($count));
00046         }
00047         
00048         public function available()
00049         {
00050             return 0;
00051         }
00052         
00053         public function getWhole()
00054         {
00055             while (!$this->isEof())
00056                 $result .= $this->read(self::BLOCK_SIZE);   
00057             
00058             return $result;
00059         }
00060     }
00061 ?>

Generated on Sun Dec 9 21:56:24 2007 for onPHP by  doxygen 1.5.4