Esempio n. 1
0
 /**
  * @return int
  */
 public function read_long()
 {
     $byte = ord($this->next_byte());
     $bytes = array($byte);
     while (0 != ($byte & 0x80)) {
         $byte = ord($this->next_byte());
         $bytes[] = $byte;
     }
     if (Avro::uses_gmp()) {
         return AvroGMP::decode_long_from_array($bytes);
     }
     return self::decode_long_from_array($bytes);
 }
Esempio n. 2
0
 /**
  * @return resource GMP resource for 64-bits of 1
  */
 private static function gmp_0xfs()
 {
     if (!isset(self::$gmp_0xfs)) {
         self::$gmp_0xfs = gmp_init('0xffffffffffffffff');
     }
     return self::$gmp_0xfs;
 }