ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
AMFReader Class Reference
+ Collaboration diagram for AMFReader:

Public Member Functions

 __construct (&$stream)
 
 readData ()
 
 readDouble ()
 
 readBoolean ()
 
 readString ()
 
 readObject ()
 
 readMixedArray ()
 
 readArray ()
 
 readDate ()
 
 readLongString ()
 
 readXML ()
 
 readTypedObject ()
 

Data Fields

 $stream
 

Detailed Description

Definition at line 473 of file module.audio-video.flv.php.

Constructor & Destructor Documentation

◆ __construct()

AMFReader::__construct ( $stream)

Definition at line 476 of file module.audio-video.flv.php.

476 {
477 $this->stream =& $stream;
478 }

References $stream.

Member Function Documentation

◆ readArray()

AMFReader::readArray ( )

Definition at line 600 of file module.audio-video.flv.php.

600 {
601 $length = $this->stream->readLong();
602 $data = array();
603
604 for ($i = 0; $i < $length; $i++) {
605 $data[] = $this->readData();
606 }
607 return $data;
608 }
$i
Definition: disco.tpl.php:19

References $data, $i, and readData().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readBoolean()

AMFReader::readBoolean ( )

Definition at line 554 of file module.audio-video.flv.php.

554 {
555 return $this->stream->readByte() == 1;
556 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readData()

AMFReader::readData ( )

Definition at line 480 of file module.audio-video.flv.php.

480 {
481 $value = null;
482
483 $type = $this->stream->readByte();
484 switch ($type) {
485
486 // Double
487 case 0:
488 $value = $this->readDouble();
489 break;
490
491 // Boolean
492 case 1:
493 $value = $this->readBoolean();
494 break;
495
496 // String
497 case 2:
498 $value = $this->readString();
499 break;
500
501 // Object
502 case 3:
503 $value = $this->readObject();
504 break;
505
506 // null
507 case 6:
508 return null;
509 break;
510
511 // Mixed array
512 case 8:
513 $value = $this->readMixedArray();
514 break;
515
516 // Array
517 case 10:
518 $value = $this->readArray();
519 break;
520
521 // Date
522 case 11:
523 $value = $this->readDate();
524 break;
525
526 // Long string
527 case 13:
528 $value = $this->readLongString();
529 break;
530
531 // XML (handled as string)
532 case 15:
533 $value = $this->readXML();
534 break;
535
536 // Typed object (handled as object)
537 case 16:
538 $value = $this->readTypedObject();
539 break;
540
541 // Long string
542 default:
543 $value = '(unknown or unsupported data type)';
544 break;
545 }
546
547 return $value;
548 }
$type

References $type, readArray(), readBoolean(), readDate(), readDouble(), readLongString(), readMixedArray(), readObject(), readString(), readTypedObject(), and readXML().

Referenced by readArray(), readMixedArray(), and readObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readDate()

AMFReader::readDate ( )

Definition at line 610 of file module.audio-video.flv.php.

610 {
611 $timestamp = $this->stream->readDouble();
612 $timezone = $this->stream->readInt();
613 return $timestamp;
614 }
foreach($mandatory_scripts as $file) $timestamp
Definition: buildRTE.php:81

References $timestamp.

Referenced by readData().

+ Here is the caller graph for this function:

◆ readDouble()

AMFReader::readDouble ( )

Definition at line 550 of file module.audio-video.flv.php.

550 {
551 return $this->stream->readDouble();
552 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readLongString()

AMFReader::readLongString ( )

Definition at line 616 of file module.audio-video.flv.php.

616 {
617 return $this->stream->readLongUTF();
618 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readMixedArray()

AMFReader::readMixedArray ( )

Definition at line 579 of file module.audio-video.flv.php.

579 {
580 // Get highest numerical index - ignored
581 $highestIndex = $this->stream->readLong();
582
583 $data = array();
584
585 while ($key = $this->stream->readUTF()) {
586 if (is_numeric($key)) {
587 $key = (float) $key;
588 }
589 $data[$key] = $this->readData();
590 }
591 // Mixed array record ends with empty string (0x00 0x00) and 0x09
592 if (($key == '') && ($this->stream->peekByte() == 0x09)) {
593 // Consume byte
594 $this->stream->readByte();
595 }
596
597 return $data;
598 }
$key
Definition: croninfo.php:18

References $data, $key, and readData().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readObject()

AMFReader::readObject ( )

Definition at line 562 of file module.audio-video.flv.php.

562 {
563 // Get highest numerical index - ignored
564// $highestIndex = $this->stream->readLong();
565
566 $data = array();
567
568 while ($key = $this->stream->readUTF()) {
569 $data[$key] = $this->readData();
570 }
571 // Mixed array record ends with empty string (0x00 0x00) and 0x09
572 if (($key == '') && ($this->stream->peekByte() == 0x09)) {
573 // Consume byte
574 $this->stream->readByte();
575 }
576 return $data;
577 }

References $data, $key, and readData().

Referenced by readData(), and readTypedObject().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readString()

AMFReader::readString ( )

Definition at line 558 of file module.audio-video.flv.php.

558 {
559 return $this->stream->readUTF();
560 }

Referenced by readData().

+ Here is the caller graph for this function:

◆ readTypedObject()

AMFReader::readTypedObject ( )

Definition at line 624 of file module.audio-video.flv.php.

624 {
625 $className = $this->stream->readUTF();
626 return $this->readObject();
627 }

References readObject().

Referenced by readData().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ readXML()

AMFReader::readXML ( )

Definition at line 620 of file module.audio-video.flv.php.

620 {
621 return $this->stream->readLongUTF();
622 }

Referenced by readData().

+ Here is the caller graph for this function:

Field Documentation

◆ $stream

AMFReader::$stream

Definition at line 474 of file module.audio-video.flv.php.

Referenced by __construct().


The documentation for this class was generated from the following file: