Exemple #1
0
 /**
  * Decode an Anything field
  *
  * @param \LibDNS\Decoder\DecodingContext $decodingContext
  * @param \LibDNS\Records\Types\Anything $anything The object to populate with the result
  * @param int $length
  * @return int The number of packet bytes consumed by the operation
  * @throws \UnexpectedValueException When the packet data is invalid
  */
 private function decodeAnything(DecodingContext $decodingContext, Anything $anything, $length)
 {
     $anything->setValue($this->readDataFromPacket($decodingContext->getPacket(), $length));
     return $length;
 }
Exemple #2
0
 /**
  * Encode an Anything field
  *
  * @param \LibDNS\Records\Types\Anything $anything
  * @return string
  */
 private function encodeAnything(Anything $anything)
 {
     return $anything->getValue();
 }