MCPcopy Create free account
hub / github.com/apache/avro / read

Method read

lang/php/lib/IO/AvroStringIO.php:124–137  ·  view source on GitHub ↗

* @returns string bytes read from buffer * @todo test for fencepost errors wrt updating current_index */

($len)

Source from the content-addressed store, hash-verified

122 * @todo test for fencepost errors wrt updating current_index
123 */
124 public function read($len)
125 {
126 $this->checkClosed();
127 $read = '';
128 for ($i = $this->current_index; $i < ($this->current_index + $len); $i++) {
129 $read .= $this->string_buffer[$i] ?? '';
130 }
131 if (strlen($read) < $len) {
132 $this->current_index = $this->length();
133 } else {
134 $this->current_index += $len;
135 }
136 return $read;
137 }
138
139 /**
140 * @returns int count of bytes in the buffer

Callers

nothing calls this directly

Calls 2

checkClosedMethod · 0.95
lengthMethod · 0.95

Tested by

no test coverage detected