void
rrFromWire(DNSInput in) throws IOException {
	precedence = in.readU8();
	gatewayType = in.readU8();
	algorithmType = in.readU8();
	switch (gatewayType) {
	case Gateway.None:
		gateway = null;
		break;
	case Gateway.IPv4:
		gateway = InetAddress.getByAddress(in.readByteArray(4));
		break;
	case Gateway.IPv6:
		gateway = InetAddress.getByAddress(in.readByteArray(16));
		break;
	case Gateway.Name:
		gateway = new Name(in);
		break;
	default:
		throw new WireParseException("invalid gateway type");
	}
	if (in.remaining() > 0)
		key = in.readByteArray();
}
Creates an IPSECKEY Record from the given data.
@param precedence The record's precedence.
@param gatewayType The record's gateway type.
@param algorithmType The record's algorithm type.
@param gateway The record's gateway.
@param key The record's public key.
src/main/java/core/org/xbill/DNS/IPSECKEYRecord.java