InputStream.class.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************************
00003  *   Copyright (C) 2007 by Ivan Y. Khvostishkov                            *
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: InputStream.class.php 4687 2007-12-09 18:57:18Z voxus $ */
00012 
00016     abstract class InputStream
00017     {
00033         abstract public function read($length);
00034         
00035         public function isEof()
00036         {
00037             return false;
00038         }
00039         
00043         public function mark()
00044         {
00045             /* nop */
00046             
00047             return $this;
00048         }
00049         
00050         public function markSupported()
00051         {
00052             return false;
00053         }
00054         
00055         public function reset()
00056         {
00057             throw new IOException(
00058                 'mark has been invalidated'
00059             );
00060         }
00061         
00062         public function skip($count)
00063         {
00064             return strlen($this->read($count));
00065         }
00066         
00067         public function available()
00068         {
00069             return 0;
00070         }
00071         
00075         public function close()
00076         {
00077             /* nop */
00078             
00079             return $this;
00080         }
00081     }
00082 ?>

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