Changeset 815 for trunk/includes/MemoryStream.php
- Timestamp:
- Feb 22, 2015, 11:05:49 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/MemoryStream.php
r553 r815 5 5 public $Data; 6 6 public $Position; 7 7 8 8 function __construct() 9 9 { 10 10 $this->Data = ''; 11 11 $this->Position = 0; 12 } 13 14 function __destruct() 12 } 13 14 function __destruct() 15 15 { 16 16 } 17 17 18 18 public function ReadBlock($Count) 19 19 { … … 22 22 return($Result); 23 23 } 24 24 25 25 public function ReadByte() 26 26 { … … 28 28 $this->Position = $this->Position + 1; 29 29 return($Result); 30 } 31 30 } 31 32 32 public function ReadUint() 33 33 { … … 36 36 return($val[1]); 37 37 } 38 38 39 39 public function ReadInt() 40 40 { … … 42 42 $this->Position = $this->Position + 4; 43 43 return($val[1]); 44 } 45 44 } 45 46 46 public function ReadFloat() 47 47 { … … 50 50 return($val[1]); 51 51 } 52 52 53 53 public function ReadChar() 54 54 { … … 75 75 $this->Data = substr_replace($this->Data, $Value, $this->Position, $Count); 76 76 $this->Position = $this->Position + $Count; 77 } 77 } 78 78 79 79 public function WriteByte($Value) … … 81 81 $this->Data[$this->Position] = pack('C*', $Value); 82 82 $this->Position++; 83 } 84 83 } 84 85 85 public function WriteUint($Value) 86 86 { 87 87 $this->WriteBlock(pack('V*', $Value), 4); 88 88 } 89 89 90 90 public function WriteInt($Value) 91 91 { 92 92 $this->WriteBlock(pack('I*', $Value), 4); 93 } 94 93 } 94 95 95 public function WriteFloat($Value) 96 96 { 97 97 $this->WriteBlock(pack('f*', $Value), 4); 98 98 } 99 99 100 100 public function WriteChar($Value) 101 101 { 102 102 $this->Data[$this->Position] = pack('C*', $Value); 103 103 $this->Position++; 104 } 105 104 } 105 106 106 public function WriteLine($Value) 107 107 { … … 113 113 $this->Position = $Position; 114 114 } 115 115 116 116 public function GetPosition() 117 117 { 118 118 return($this->Position); 119 119 } 120 120 121 121 public function GetSize() 122 122 {
Note:
See TracChangeset
for help on using the changeset viewer.