Fix missing methods/method signatures

git-svn-id: http://php-reader.googlecode.com/svn/branches/zend@175 51a70ab9-7547-0410-9469-37e369ee0574
This commit is contained in:
svollbehr
2010-03-08 09:24:50 +00:00
parent ed2748cf6c
commit 267ed3632d
2 changed files with 84 additions and 6 deletions

View File

@@ -28,7 +28,7 @@
* @author Sven Vollbehr <sven@vollbehr.eu>
* @author Ryan Butterfield <buttza@gmail.com>
* @author Marc Bennewitz <marc-bennewitz@arcor.de>
* @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
* @copyright Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
* @version $Id$
*/
@@ -273,6 +273,18 @@ class Zend_Io_Reader
}
}
/**
* Reads 2 bytes from the stream and returns machine ordered binary data
* as signed 16-bit integer.
*
* @return integer
* @throws Zend_Io_Exception if an I/O error occurs
*/
public final function readInt16()
{
return $this->_fromInt16($this->read(2));
}
/**
* Returns machine endian ordered binary data as unsigned 16-bit integer.
*
@@ -313,6 +325,18 @@ class Zend_Io_Reader
return $this->_fromUInt16($this->read(2), self::BIG_ENDIAN_ORDER);
}
/**
* Reads 2 bytes from the stream and returns machine ordered binary data
* as unsigned 16-bit integer.
*
* @return integer
* @throws Zend_Io_Exception if an I/O error occurs
*/
public final function readUInt16()
{
return $this->_fromUInt16($this->read(2), self::MACHINE_ENDIAN_ORDER);
}
/**
* Returns machine-endian ordered binary data as signed 32-bit integer.
*
@@ -355,6 +379,18 @@ class Zend_Io_Reader
return $this->_fromInt32($this->read(4));
}
/**
* Reads 4 bytes from the stream and returns machine ordered binary data
* as signed 32-bit integer.
*
* @return integer
* @throws Zend_Io_Exception if an I/O error occurs
*/
public final function readInt32()
{
return $this->_fromInt32($this->read(4));
}
/**
* Reads 4 bytes from the stream and returns little-endian ordered binary
* data as unsigned 32-bit integer.
@@ -391,6 +427,24 @@ class Zend_Io_Reader
}
}
/**
* Reads 4 bytes from the stream and returns machine ordered binary data
* as unsigned 32-bit integer.
*
* @return integer
* @throws Zend_Io_Exception if an I/O error occurs
*/
public final function readUInt32()
{
if (PHP_INT_SIZE < 8) {
list(, $hi, $lo) = unpack('L*', $this->read(4));
return $hi * (0xffff+1) + $lo; // eq $hi << 16 | $lo
} else {
list(, $int) = unpack('L*', $this->read(4));
return $int;
}
}
/**
* Reads 8 bytes from the stream and returns little-endian ordered binary
* data as 64-bit float.