Lines Matching refs:buffer
7 * Provides a buffer stream that can be written to to fill a buffer, and read
8 * from to remove bytes from the buffer.
12 * preferred size of the buffer.
19 private $buffer = '';
23 * buffer size. If the size of the buffer exceeds the high
26 * until the buffer has been drained by reading from it.
40 $buffer = $this->buffer;
41 $this->buffer = '';
43 return $buffer;
48 $this->buffer = '';
63 return strlen($this->buffer);
88 return strlen($this->buffer) === 0;
97 * Reads data from the buffer.
101 $currentLength = strlen($this->buffer);
104 // No need to slice the buffer because we don't have enough data.
105 $result = $this->buffer;
106 $this->buffer = '';
108 // Slice up the result to provide a subset of the buffer.
109 $result = substr($this->buffer, 0, $length);
110 $this->buffer = substr($this->buffer, $length);
117 * Writes data to the buffer.
121 $this->buffer .= $string;
123 if (strlen($this->buffer) >= $this->hwm) {