55 if (is_array($stack)) {
56 $this->_array = $stack;
57 $this->_arraySize = count($stack);
58 }
elseif (is_string($stack)) {
61 $this->_array = array();
77 public function read($length)
79 if ($this->_offset == $this->_arraySize) {
85 $end = $this->_arraySize < $end
103 $to_add = str_split($bytes);
104 foreach ($to_add as $value) {
105 $this->_array[] = $value;
107 $this->_arraySize = count($this->_array);
109 foreach ($this->_mirrors as $stream) {
110 $stream->write($bytes);
131 $this->_mirrors[] = $is;
145 foreach ($this->_mirrors as $k => $stream) {
146 if ($is === $stream) {
147 unset($this->_mirrors[$k]);
161 if ($byteOffset > $this->_arraySize) {
163 }
elseif ($byteOffset < 0) {
167 $this->_offset = $byteOffset;
177 $this->_array = array();
178 $this->_arraySize = 0;
180 foreach ($this->_mirrors as $stream) {
181 $stream->flushBuffers();