public function testWriteCompletelyWithBigRequest() { $topicSize = 9000; $this->topic = str_repeat('a', $topicSize); //bigger than the fread buffer, 8192 $this->req = new Kafka_FetchRequest($this->topic, $this->partition, $this->offset); $this->obj = new Kafka_BoundedByteBuffer_Send($this->req); // 4 bytes = size // 2 bytes = request ID $this->assertEquals(4 + $this->req->sizeInBytes() + 2, $this->obj->writeCompletely($this->stream)); }
/** * Send the request * * @param Kafka_FetchRequest $req Request * * @return void */ protected function sendRequest(Kafka_FetchRequest $req) { $send = new Kafka_BoundedByteBuffer_Send($req); $send->writeCompletely($this->conn); }