Protobuf\Binary\StreamWriter::writeSFixed64 PHP Method

writeSFixed64() public method

Encode an integer as a fixed of 64bits with sign.
public writeSFixed64 ( Stream $stream, integer $value )
$stream Protobuf\Stream
$value integer
    public function writeSFixed64(Stream $stream, $value)
    {
        if ($value >= 0) {
            $this->writeFixed64($stream, $value);
            return;
        }
        $bytes = $this->negativeEncoder->encodeSFixed64($value);
        $this->writeBytes($stream, $bytes);
    }

Usage Example

 /**
  * @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);
 }
All Usage Examples Of Protobuf\Binary\StreamWriter::writeSFixed64