public function writeSFixed64(Stream $stream, $value) { if ($value >= 0) { $this->writeFixed64($stream, $value); return; } $bytes = $this->negativeEncoder->encodeSFixed64($value); $this->writeBytes($stream, $bytes); }
/** * @dataProvider providerSFixed64 */ public function testComputeSFixed64Size($value) { $stream = Stream::create(); $this->writer->writeSFixed64($stream, $value); $streamSize = $stream->getSize(); $actualSize = $this->calculator->computeSFixed64Size($value); $this->assertEquals($streamSize, $actualSize); }