/** * Decode an IPv6Address field * * @param \LibDNS\Decoder\DecodingContext $decodingContext * @param \LibDNS\Records\Types\IPv6Address $ipv6Address The object to populate with the result * @return int The number of packet bytes consumed by the operation * @throws \UnexpectedValueException When the packet data is invalid */ private function decodeIPv6Address(DecodingContext $decodingContext, IPv6Address $ipv6Address) { $shorts = unpack('n8', $this->readDataFromPacket($decodingContext->getPacket(), 16)); $ipv6Address->setShorts($shorts); return 16; }