public function write($bytes, $length) { $written = fwrite($this->stream, $bytes, $length); if ($written !== $length) { throw new RuntimeException('Failed to write ' . $length . ' bytes'); } $this->size = null; return $written; }
/** * Store a single byte. * * @param \Protobuf\Stream $stream * @param integer $value */ public function writeByte(Stream $stream, $value) { $stream->write(chr($value), 1); }