diff --git a/src/ISO14496.php b/src/ISO14496.php
index 068f4a0..c3f7cef 100644
--- a/src/ISO14496.php
+++ b/src/ISO14496.php
@@ -7,12 +7,12 @@
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
- * - Redistributions of source code must retain the above copyright notice,
+ *
Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
- * - Redistributions in binary form must reproduce the above copyright notice,
+ * Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
- * - Neither the name of the project workgroup nor the names of its
+ * Neither the name of the project workgroup nor the names of its
* contributors may be used to endorse or promote products derived from this
* software without specific prior written permission.
*
@@ -57,6 +57,149 @@ require_once("ISO14496/Box.php");
* general.
*
* The ISO Base Media File Format is a base format for media file formats.
+ *
+ *
+ * An overall view of the normal encapsulation structure is provided in the
+ * following table.
+ *
+ * The table shows those boxes that may occur at the top-level in the left-most
+ * column; indentation is used to show possible containment. Thus, for example,
+ * a {@link ISO14496_Box_TKHD Track Header Box} is found in a
+ * {@link ISO14496_Box_TRAK Track Box}, which is found in a
+ * {@link ISO14496_Box_MOOV Movie Box}. Not all boxes need be used in all files;
+ * the mandatory boxes are marked with bold typeface. See the description of the
+ * individual boxes for a discussion of what must be assumed if the optional
+ * boxes are not present.
+ *
+ * User data objects shall be placed only in {@link ISO14496_Box_MOOV Movie} or
+ * {@link ISO14496_Box_TRAK Track Boxes}, and objects using an extended type may
+ * be placed in a wide variety of containers, not just the top level.
+ *
+ *
+ * - ftyp -- {@link ISO14496_Box_FTYP File Type Box}; file type and compatibility
+ *
- pdin -- {@link ISO14496_Box_PDIN Progressive Download Information Box}
+ *
- moov -- {@link ISO14496_Box_MOOV Movie Box}; container for all the metadata
+ *
+ * - mvhd -- {@link ISO14496_Box_MVHD Movie Header Box}; overall declarations
+ *
- trak -- {@link ISO14496_Box_TRAK Track Box}; container for an individual track or stream
+ *
+ * - tkhd -- {@link ISO14496_Box_TKHD Track Header Box}; overall information about the track
+ *
- tref -- {@link ISO14496_Box_TREF Track Reference Box}
+ *
- edts -- {@link ISO14496_Box_EDTS Edit Box}
+ *
+ * - elst -- {@link ISO14496_Box_ELST Edit List Box}
+ *
+ * - mdia -- {@link ISO14496_Box_MDIA Media Box}
+ *
+ * - mdhd -- {@link ISO14496_Box_MDHD Media Header Box}; overall information about the media
+ *
- hdlr -- {@link ISO14496_Box_HDLR Handler Reference Box}; declares the media type
+ *
- minf -- {@link ISO14496_Box_MINF Media Information Box}
+ *
+ * - vmhd -- {@link ISO14496_Box_VMHD Video Media Header Box}; overall information (video track only)
+ *
- smhd -- {@link ISO14496_Box_SMHD Sound Media Header Box}; overall information (sound track only)
+ *
- hmhd -- {@link ISO14496_Box_HMHD Hint Media Header Box}; overall information (hint track only)
+ *
- nmhd -- {@link ISO14496_Box_NMHD Null Media Header Box}; overall information (some tracks only)
+ *
- dinf -- {@link ISO14496_Box_DINF Data Information Box}
+ *
+ * - dref -- {@link ISO14496_Box_DREF Data Reference Box}
+ *
+ * - stbl -- {@link ISO14496_Box_STBL Sample Table Box}
+ *
+ * - stsd -- {@link ISO14496_Box_STSD Sample Descriptions Box}
+ *
- stts -- {@link ISO14496_Box_STTS Decoding Time To Sample Box}
+ *
- ctts -- {@link ISO14496_Box_CTTS Composition Time To Sample Box}
+ *
- stsc -- {@link ISO14496_Box_STSC Sample To Chunk Box}
+ *
- stsz -- {@link ISO14496_Box_STSZ Sample Size Box}
+ *
- stz2 -- {@link ISO14496_Box_STZ2 Compact Sample Size Box}
+ *
- stco -- {@link ISO14496_Box_STCO Chunk Offset Box}; 32-bit
+ *
- co64 -- {@link ISO14496_Box_CO64 Chunk Ooffset Box}; 64-bit
+ *
- stss -- {@link ISO14496_Box_STSS Sync Sample Table Box}
+ *
- stsh -- {@link ISO14496_Box_STSH Shadow Sync Sample Table Box}
+ *
- padb -- {@link ISO14496_Box_PADB Padding Bits Box}
+ *
- stdp -- {@link ISO14496_Box_STDP Sample Degradation Priority Box}
+ *
- sdtp -- {@link ISO14496_Box_SDTP Independent and Disposable Samples Box}
+ *
- sbgp -- {@link ISO14496_Box_SBGP Sample To Group Box}
+ *
- sgpd -- {@link ISO14496_Box_SGPD Sample Group Description}
+ *
- subs -- {@link ISO14496_Box_SUBS Sub-Sample Information Box}
+ *
+ *
+ *
+ *
+ * - mvex -- {@link ISO14496_Box_MVEX Movie Extends Box}
+ *
+ * - mehd -- {@link ISO14496_Box_MEHD Movie Extends Header Box}
+ *
- trex -- {@link ISO14496_Box_TREX Track Extends Box}
+ *
+ * - ipmc -- {@link ISO14496_Box_IPMC IPMP Control Box}
+ *
+ * - moof -- {@link ISO14496_Box_MOOF Movie Fragment Box}
+ *
+ * - mfhd -- {@link ISO14496_Box_MFHD Movie Fragment Header Box}
+ *
- traf -- {@link ISO14496_Box_TRAF Track Fragment Box}
+ *
+ * - tfhd -- {@link ISO14496_Box_TFHD Track Fragment Header Box}
+ *
- trun -- {@link ISO14496_Box_TRUN Track Fragment Run}
+ *
- sdtp -- {@link ISO14496_Box_SDTP Independent and Disposable Samples}
+ *
- sbgp -- {@link ISO14496_Box_SBGP SampleToGroup Box}
+ *
- subs -- {@link ISO14496_Box_SUBS Sub-Sample Information Box}
+ *
+ *
+ * - mfra -- {@link ISO14496_Box_MFRA Movie Fragment Random Access Box}
+ *
+ * - tfra -- {@link ISO14496_Box_TFRA Track Fragment Random Access Box}
+ *
- mfro -- {@link ISO14496_Box_MFRO Movie Fragment Random Access Offset Box}
+ *
+ * - mdat -- {@link ISO14496_Box_MDAT Media Data Box}
+ *
- free -- {@link ISO14496_Box_FREE Free Space Box}
+ *
- skip -- {@link ISO14496_Box_SKIP Free Space Box}
+ *
+ * - udta -- {@link ISO14496_Box_UDTA User Data Box}
+ *
+ * - cprt -- {@link ISO14496_Box_CPRT Copyright Box}
+ *
+ *
+ * - meta -- {@link ISO14496_Box_META The Meta Box}
+ *
+ * - hdlr -- {@link ISO14496_Box_HDLR Handler Reference Box}; declares the metadata type
+ *
- dinf -- {@link ISO14496_Box_DINF Data Information Box}
+ *
+ * - dref -- {@link ISO14496_Box_DREF Data Reference Box}; declares source(s) of metadata items
+ *
+ * - ipmc -- {@link ISO14496_Box_IPMC IPMP Control Box}
+ *
- iloc -- {@link ISO14496_Box_ILOC Item Location Box}
+ *
- ipro -- {@link ISO14496_Box_IPRO Item Protection Box}
+ *
+ * - sinf -- {@link ISO14496_Box_SINF Protection Scheme Information Box}
+ *
+ * - frma -- {@link ISO14496_Box_FRMA Original Format Box}
+ *
- imif -- {@link ISO14496_Box_IMIF IPMP Information Box}
+ *
- schm -- {@link ISO14496_Box_SCHM Scheme Type Box}
+ *
- schi -- {@link ISO14496_Box_SCHI Scheme Information Box}
+ *
+ *
+ * - iinf -- {@link ISO14496_Box_IINF Item Information Box}
+ *
+ * - infe -- {@link ISO14496_Box_INFE Item Information Entry Box}
+ *
+ * - xml -- {@link ISO14496_Box_XML XML Box}
+ *
- bxml -- {@link ISO14496_Box_BXML Binary XML Box}
+ *
- pitm -- {@link ISO14496_Box_PITM Primary Item Reference Box}
+ *
+ *
+ *
+ * There are two non-standard extensions to the ISO 14496 standard that add the
+ * ability to include file meta information. Both the boxes reside under
+ * moov.udta.meta.
+ *
+ *
+ * - moov -- {@link ISO14496_Box_MOOV Movie Box}; container for all the metadata
+ *
- udta -- {@link ISO14496_Box_UDTA User Data Box}
+ *
- meta -- {@link ISO14496_Box_META The Meta Box}
+ *
+ * - ilst -- {@link ISO14496_Box_ILST The iTunes/iPod Tag Container Box}
+ *
- id32 -- {@link ISO14496_Box_ID32 The ID3v2 Box}
+ *
+ *
*
* @package php-reader
* @subpackage ISO 14496
diff --git a/src/ISO14496/Box.php b/src/ISO14496/Box.php
index 3de1aaa..a2071ba 100644
--- a/src/ISO14496/Box.php
+++ b/src/ISO14496/Box.php
@@ -242,11 +242,25 @@ class ISO14496_Box
* @param string $name The box or field name.
* @return mixed
*/
- public function __get($name) {
+ public function __get($name)
+ {
if ($this->isContainer() && isset($this->_boxes[$name]))
return $this->_boxes[$name][0];
if (method_exists($this, "get" . ucfirst($name)))
return call_user_func(array($this, "get" . ucfirst($name)));
throw new ISO14496_Exception("Unknown box/field: " . $name);
}
+
+ /**
+ * Magic function so that isset($obj->value) will work. This method checks
+ * whether the box is a container and contains a box that matches the
+ * identifier.
+ *
+ * @param string $name The box name.
+ * @return boolean
+ */
+ public function __isset($name)
+ {
+ return ($this->isContainer() && isset($this->_boxes[$name]));
+ }
}
diff --git a/src/ISO14496/Box/BXML.php b/src/ISO14496/Box/BXML.php
index e0c7f82..fb8e821 100644
--- a/src/ISO14496/Box/BXML.php
+++ b/src/ISO14496/Box/BXML.php
@@ -65,7 +65,6 @@ final class ISO14496_Box_BXML extends ISO14496_Box_Full
* the ISO Base Media file.
*
* @param Reader $reader The reader object.
- * @todo The sample flags could be parsed further
*/
public function __construct($reader)
{
diff --git a/src/ISO14496/Box/CO64.php b/src/ISO14496/Box/CO64.php
index ea62212..51f7b80 100644
--- a/src/ISO14496/Box/CO64.php
+++ b/src/ISO14496/Box/CO64.php
@@ -80,15 +80,13 @@ final class ISO14496_Box_CO64 extends ISO14496_Box_Full
$entryCount = $this->_reader->readUInt32BE();
for ($i = 1; $i < $entryCount; $i++)
- $this->_chunkOffsetTable[$i] = array
- ("chunkOffset" => $this->_reader->readInt64BE());
+ $this->_chunkOffsetTable[$i] = $this->_reader->readInt64BE();
}
/**
- * Returns an array of values. Each entry is an array containing the following
- * keys.
- * o chunkOffset -- a 64 bit integer that gives the offset of the start of a
- * chunk into its containing media file.
+ * Returns an array of values. Each entry has the entry number as its index
+ * and a 64 bit integer that gives the offset of the start of a chunk into
+ * its containing media file as its value.
*
* @return Array
*/
diff --git a/src/ISO14496/Box/ELST.php b/src/ISO14496/Box/ELST.php
index 1e80958..bc81fde 100644
--- a/src/ISO14496/Box/ELST.php
+++ b/src/ISO14496/Box/ELST.php
@@ -92,7 +92,7 @@ final class ISO14496_Box_ELST extends ISO14496_Box_Full
* media time scale units, in composition time). If this field is set to
* –1, it is an empty edit. The last edit in a track shall never be an
* empty edit. Any difference between the duration in the
- * {@link ISO14496_Box_MVHD Movie Header Box}, and the track’s duration is
+ * {@link ISO14496_Box_MVHD Movie Header Box}, and the track's duration is
* expressed as an implicit empty edit at the end.
* o mediaRate: the relative rate at which to play the media corresponding
* to this edit segment. If this value is 0, then the edit is specifying
diff --git a/src/ISO14496/Box/HDLR.php b/src/ISO14496/Box/HDLR.php
index f2e0e00..5112481 100644
--- a/src/ISO14496/Box/HDLR.php
+++ b/src/ISO14496/Box/HDLR.php
@@ -76,7 +76,7 @@ final class ISO14496_Box_HDLR extends ISO14496_Box_Full
$this->_reader->skip(4);
$this->_handlerType = $this->_reader->read(4);
$this->_reader->skip(12);
- $this->_name = $this->_reader->read
+ $this->_name = $this->_reader->readString8
($this->_offset + $this->_size - $this->_reader->getOffset());
}
diff --git a/src/ISO14496/Box/MINF.php b/src/ISO14496/Box/MINF.php
index bac8d43..017e621 100644
--- a/src/ISO14496/Box/MINF.php
+++ b/src/ISO14496/Box/MINF.php
@@ -52,4 +52,16 @@ require_once("ISO14496/Box.php");
*/
final class ISO14496_Box_MINF extends ISO14496_Box
{
+ /**
+ * Constructs the class with given parameters and reads box related data from
+ * the ISO Base Media file.
+ *
+ * @param Reader $reader The reader object.
+ */
+ public function __construct($reader)
+ {
+ parent::__construct($reader);
+ $this->setContainer(true);
+ $this->constructBoxes();
+ }
}
diff --git a/src/ISO14496/Box/MVHD.php b/src/ISO14496/Box/MVHD.php
index aa6a6e7..2ff90dc 100644
--- a/src/ISO14496/Box/MVHD.php
+++ b/src/ISO14496/Box/MVHD.php
@@ -131,7 +131,7 @@ final class ISO14496_Box_MVHD extends ISO14496_Box_Full
/**
* Returns the length of the presentation in the indicated timescale. This
- * property is derived from the presentation’s tracks: the value of this field
+ * property is derived from the presentation's tracks: the value of this field
* corresponds to the duration of the longest track in the presentation.
*
* @return integer
diff --git a/src/ISO14496/Box/PITM.php b/src/ISO14496/Box/PITM.php
index 8b913b8..b9fed10 100644
--- a/src/ISO14496/Box/PITM.php
+++ b/src/ISO14496/Box/PITM.php
@@ -65,7 +65,6 @@ final class ISO14496_Box_PITM extends ISO14496_Box_Full
* the ISO Base Media file.
*
* @param Reader $reader The reader object.
- * @todo The sample flags could be parsed further
*/
public function __construct($reader)
{
diff --git a/src/ISO14496/Box/STGP.php b/src/ISO14496/Box/SBGP.php
similarity index 98%
rename from src/ISO14496/Box/STGP.php
rename to src/ISO14496/Box/SBGP.php
index 8ad17d4..606dc28 100644
--- a/src/ISO14496/Box/STGP.php
+++ b/src/ISO14496/Box/SBGP.php
@@ -62,7 +62,7 @@ require_once("ISO14496/Box/Full.php");
* @license http://code.google.com/p/php-reader/wiki/License New BSD License
* @version $Rev$
*/
-final class ISO14496_Box_STGP extends ISO14496_Box_Full
+final class ISO14496_Box_SBGP extends ISO14496_Box_Full
{
/** @var integer */
private $_groupingType;
diff --git a/src/ISO14496/Box/STCO.php b/src/ISO14496/Box/STCO.php
index 33a2fef..66c0d27 100644
--- a/src/ISO14496/Box/STCO.php
+++ b/src/ISO14496/Box/STCO.php
@@ -79,16 +79,14 @@ final class ISO14496_Box_STCO extends ISO14496_Box_Full
parent::__construct($reader);
$entryCount = $this->_reader->readUInt32BE();
- for ($i = 0; $i < $entryCount; $i++)
- $this->_chunkOffsetTable[] = array
- ("chunkOffset" => $this->_reader->readUInt32BE());
+ for ($i = 1; $i < $entryCount; $i++)
+ $this->_chunkOffsetTable[$i] = $this->_reader->readUInt32BE();
}
/**
- * Returns an array of values. Each entry is an array containing the following
- * keys.
- * o chunkOffset -- a 32 bit integer that gives the offset of the start of a
- * chunk into its containing media file.
+ * Returns an array of values. Each entry has the entry number as its index
+ * and a 32 bit integer that gives the offset of the start of a chunk into
+ * its containing media file as its value.
*
* @return Array
*/
diff --git a/src/ISO14496/Box/STSS.php b/src/ISO14496/Box/STSS.php
index a726657..662e2b5 100644
--- a/src/ISO14496/Box/STSS.php
+++ b/src/ISO14496/Box/STSS.php
@@ -69,15 +69,13 @@ final class ISO14496_Box_STSS extends ISO14496_Box_Full
$entryCount = $this->_reader->readUInt32BE();
for ($i = 1; $i < $entryCount; $i++)
- $this->_syncSampleTable[$i] = array
- ("sampleNumber" => $this->_reader->readUInt32BE());
+ $this->_syncSampleTable[$i] = $this->_reader->readUInt32BE();
}
/**
- * Returns an array of values. Each entry is an array containing the following
- * keys.
- * o sampleNumber -- gives the numbers of the samples that are random access
- * points in the stream.
+ * Returns an array of values. Each entry has the entry number as its index
+ * and an integer that gives the numbers of the samples that are random access
+ * points in the stream as its value.
*
* @return Array
*/
diff --git a/src/ISO14496/Box/TKHD.php b/src/ISO14496/Box/TKHD.php
index 602c1f1..c6a8750 100644
--- a/src/ISO14496/Box/TKHD.php
+++ b/src/ISO14496/Box/TKHD.php
@@ -146,7 +146,7 @@ final class ISO14496_Box_TKHD extends ISO14496_Box_Full
/**
* Returns the duration of this track (in the timescale indicated in the
* {@link MVHD Movie Header Box}). The value of this field is equal to the sum
- * of the durations of all of the track’s edits. If there is no edit list,
+ * of the durations of all of the track's edits. If there is no edit list,
* then the duration is the sum of the sample durations, converted into the
* timescale in the {@link MVHD Movie Header Box}. If the duration of this
* track cannot be determined then duration is set to all 32-bit maxint.
diff --git a/src/ISO14496/Box/XML.php b/src/ISO14496/Box/XML.php
index 8df21d4..42d8617 100644
--- a/src/ISO14496/Box/XML.php
+++ b/src/ISO14496/Box/XML.php
@@ -66,7 +66,6 @@ final class ISO14496_Box_XML extends ISO14496_Box_Full
* the ISO Base Media file.
*
* @param Reader $reader The reader object.
- * @todo The sample flags could be parsed further
*/
public function __construct($reader)
{
diff --git a/src/Transform.php b/src/Transform.php
index 66ff939..143a4e6 100644
--- a/src/Transform.php
+++ b/src/Transform.php
@@ -133,6 +133,62 @@ final class Transform
return $int;
}
+ /**
+ * Returns signed 32-bit integer as little-endian ordered binary data.
+ *
+ * @param integer $value The input value.
+ * @return string
+ */
+ public static function toInt32LE($value)
+ {
+ if (self::fromInt32("\x00\x00\x00\x01") == 1)
+ return strrev(self::toInt32($value));
+ else
+ return self::toInt32($value);
+ }
+
+ /**
+ * Returns little-endian ordered binary data as signed 32-bit integer.
+ *
+ * @param string $value The binary data string.
+ * @return integer
+ */
+ public static function fromInt32LE($value)
+ {
+ if (self::fromInt32("\x00\x00\x00\x01") == 1)
+ return self::fromInt32(strrev($value));
+ else
+ return self::fromInt32($value);
+ }
+
+ /**
+ * Returns signed 32-bit integer as big-endian ordered binary data.
+ *
+ * @param integer $value The input value.
+ * @return string
+ */
+ public static function toInt32BE($value)
+ {
+ if (self::fromInt32("\x00\x00\x00\x01") == 1)
+ return self::toInt32($value);
+ else
+ return strrev(self::toInt32($value));
+ }
+
+ /**
+ * Returns big-endian ordered binary data as signed 32-bit integer.
+ *
+ * @param string $value The binary data string.
+ * @return integer
+ */
+ public static function fromInt32BE($value)
+ {
+ if (self::fromInt32("\x00\x00\x00\x01") == 1)
+ return self::fromInt32($value);
+ else
+ return self::fromInt32(strrev($value));
+ }
+
/**
* Returns unsigned 32-bit integer as little-endian ordered binary data.
*
@@ -202,6 +258,62 @@ final class Transform
return $int;
}
+ /**
+ * Returns signed 16-bit integer as little-endian ordered binary data.
+ *
+ * @param integer $value The input value.
+ * @return string
+ */
+ public static function toInt16LE($value)
+ {
+ if (self::fromInt16("\x00\x01") == 1)
+ return strrev(self::toInt16($value));
+ else
+ return self::toInt16($value);
+ }
+
+ /**
+ * Returns little-endian ordered binary data as signed 16-bit integer.
+ *
+ * @param string $value The binary data string.
+ * @return integer
+ */
+ public static function fromInt16LE($value)
+ {
+ if (self::fromInt16("\x00\x01") == 1)
+ return self::fromInt16(strrev($value));
+ else
+ return self::fromInt16($value);
+ }
+
+ /**
+ * Returns signed 16-bit integer as big-endian ordered binary data.
+ *
+ * @param integer $value The input value.
+ * @return string
+ */
+ public static function toInt16BE($value)
+ {
+ if (self::fromInt16("\x00\x01") == 1)
+ return self::toInt16($value);
+ else
+ return strrev(self::toInt16($value));
+ }
+
+ /**
+ * Returns big-endian ordered binary data as signed 16-bit integer.
+ *
+ * @param string $value The binary data string.
+ * @return integer
+ */
+ public static function fromInt16BE($value)
+ {
+ if (self::fromInt16("\x00\x01") == 1)
+ return self::fromInt16($value);
+ else
+ return self::fromInt16(strrev($value));
+ }
+
/**
* Returns machine endian ordered binary data as unsigned 16-bit integer.
*
diff --git a/tests/TestTransform.php b/tests/TestTransform.php
index 94740d3..aad9b70 100644
--- a/tests/TestTransform.php
+++ b/tests/TestTransform.php
@@ -70,6 +70,23 @@ final class TestTransform extends PHPUnit_Framework_TestCase
{
$this->assertEquals
(0x7fffffff, Transform::fromInt32(Transform::toInt32(0x7fffffff)));
+ $this->assertEquals(-1, Transform::fromInt32(Transform::toInt32(-1)));
+ }
+
+ function testInt32LE()
+ {
+ $this->assertEquals(1, Transform::fromInt32LE("\x01\x00\x00\x00"));
+ $this->assertEquals
+ (0x7fffffff, Transform::fromInt32LE(Transform::toInt32LE(0x7fffffff)));
+ $this->assertEquals(-1, Transform::fromInt32LE(Transform::toInt32LE(-1)));
+ }
+
+ function testInt32BE()
+ {
+ $this->assertEquals(1, Transform::fromInt32BE("\x00\x00\x00\x01"));
+ $this->assertEquals
+ (0x7fffffff, Transform::fromInt32BE(Transform::toInt32BE(0x7fffffff)));
+ $this->assertEquals(-1, Transform::fromInt32BE(Transform::toInt32BE(-1)));
}
function testUInt32LE()
@@ -92,6 +109,23 @@ final class TestTransform extends PHPUnit_Framework_TestCase
{
$this->assertEquals
(0x7fff, Transform::fromInt16(Transform::toInt16(0x7fff)));
+ $this->assertEquals(-1, Transform::fromInt16(Transform::toInt16(-1)));
+ }
+
+ function testInt16LE()
+ {
+ $this->assertEquals(1, Transform::fromInt16LE("\x01\x00"));
+ $this->assertEquals
+ (0x7fff, Transform::fromInt16LE(Transform::toInt16LE(0x7fff)));
+ $this->assertEquals(-1, Transform::fromInt16LE(Transform::toInt16LE(-1)));
+ }
+
+ function testInt16BE()
+ {
+ $this->assertEquals(1, Transform::fromInt16BE("\x00\x01"));
+ $this->assertEquals
+ (0x7fff, Transform::fromInt16BE(Transform::toInt16BE(0x7fff)));
+ $this->assertEquals(-1, Transform::fromInt16BE(Transform::toInt16BE(-1)));
}
function testUInt16LE()