AMFStream

The WordPress Core AMFStream class.

Defined (1)

The class is defined in the following location(s).

/wp-includes/ID3/module.audio-video.flv.php  
  1. class AMFStream { 
  2. public $bytes; 
  3. public $pos; 
  4.  
  5. public function __construct(&$bytes) { 
  6. $this->bytes =& $bytes; 
  7. $this->pos = 0; 
  8.  
  9. public function readByte() { 
  10. return getid3_lib::BigEndian2Int(substr($this->bytes, $this->pos++, 1)); 
  11.  
  12. public function readInt() { 
  13. return ($this->readByte() << 8) + $this->readByte(); 
  14.  
  15. public function readLong() { 
  16. return ($this->readByte() << 24) + ($this->readByte() << 16) + ($this->readByte() << 8) + $this->readByte(); 
  17.  
  18. public function readDouble() { 
  19. return getid3_lib::BigEndian2Float($this->read(8)); 
  20.  
  21. public function readUTF() { 
  22. $length = $this->readInt(); 
  23. return $this->read($length); 
  24.  
  25. public function readLongUTF() { 
  26. $length = $this->readLong(); 
  27. return $this->read($length); 
  28.  
  29. public function read($length) { 
  30. $val = substr($this->bytes, $this->pos, $length); 
  31. $this->pos += $length; 
  32. return $val; 
  33.  
  34. public function peekByte() { 
  35. $pos = $this->pos; 
  36. $val = $this->readByte(); 
  37. $this->pos = $pos; 
  38. return $val; 
  39.  
  40. public function peekInt() { 
  41. $pos = $this->pos; 
  42. $val = $this->readInt(); 
  43. $this->pos = $pos; 
  44. return $val; 
  45.  
  46. public function peekLong() { 
  47. $pos = $this->pos; 
  48. $val = $this->readLong(); 
  49. $this->pos = $pos; 
  50. return $val; 
  51.  
  52. public function peekDouble() { 
  53. $pos = $this->pos; 
  54. $val = $this->readDouble(); 
  55. $this->pos = $pos; 
  56. return $val; 
  57.  
  58. public function peekUTF() { 
  59. $pos = $this->pos; 
  60. $val = $this->readUTF(); 
  61. $this->pos = $pos; 
  62. return $val; 
  63.  
  64. public function peekLongUTF() { 
  65. $pos = $this->pos; 
  66. $val = $this->readLongUTF(); 
  67. $this->pos = $pos; 
  68. return $val;