Changeset 880 for trunk/includes/MemoryStream.php
- Timestamp:
- Apr 7, 2020, 10:15:48 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/includes/MemoryStream.php
r815 r880 20 20 $Result = substr($this->Data, $this->Position, $Count); 21 21 $this->Position = $this->Position + $Count; 22 return ($Result);22 return $Result; 23 23 } 24 24 … … 27 27 $Result = $this->Data[$this->Position]; 28 28 $this->Position = $this->Position + 1; 29 return ($Result);29 return $Result; 30 30 } 31 31 … … 34 34 $val = unpack('V*', substr($this->Data, $this->Position, 4)); 35 35 $this->Position = $this->Position + 4; 36 return ($val[1]);36 return $val[1]; 37 37 } 38 38 … … 41 41 $val = unpack('I*', substr($this->Data, $this->Position, 4)); 42 42 $this->Position = $this->Position + 4; 43 return ($val[1]);43 return $val[1]; 44 44 } 45 45 … … 48 48 $val = unpack('f*', substr($this->Data, $this->Position, 4)); 49 49 $this->Position = $this->Position + 4; 50 return ($val[1]);50 return $val[1]; 51 51 } 52 52 … … 55 55 $Result = $this->Data[$this->Position]; 56 56 $this->Position = $this->Position + 1; 57 return ($Result);57 return $Result; 58 58 } 59 59 … … 62 62 $Length = 0; 63 63 $StartPosition = $this->Position; 64 while (!$this->EOF())64 while (!$this->EOF()) 65 65 { 66 66 $Char = $this->ReadChar(); 67 if ($Char == $EndSymbol) break;67 if ($Char == $EndSymbol) break; 68 68 } 69 69 $Result = substr($this->Data, $StartPosition, $this->Position - $StartPosition); 70 return ($Result);70 return $Result; 71 71 } 72 72 … … 116 116 public function GetPosition() 117 117 { 118 return ($this->Position);118 return $this->Position; 119 119 } 120 120 121 121 public function GetSize() 122 122 { 123 return (strlen($this->Data));123 return strlen($this->Data); 124 124 } 125 125 126 126 public function SetSize($Size) 127 127 { 128 return ($this->Data = substr($this->Data, 0, $Size));128 return $this->Data = substr($this->Data, 0, $Size); 129 129 } 130 130 131 131 public function EOF() 132 132 { 133 return ($this->Position >= strlen($this->Data));133 return $this->Position >= strlen($this->Data); 134 134 } 135 135 }
Note:
See TracChangeset
for help on using the changeset viewer.