this.options = new ArrayList<IpV6NeighborDiscoveryOption>();
int currentOffsetInHeader = OPTIONS_OFFSET;
while (currentOffsetInHeader < length) {
IpV6NeighborDiscoveryOptionType type
= IpV6NeighborDiscoveryOptionType.getInstance(rawData[currentOffsetInHeader + offset]);
IpV6NeighborDiscoveryOption newOne;
try {
newOne
= PacketFactories
.getFactory(
IpV6NeighborDiscoveryOption.class,
IpV6NeighborDiscoveryOptionType.class
).newInstance(
rawData,
currentOffsetInHeader + offset,
length - currentOffsetInHeader,
type
);
} catch (Exception e) {
break;
}
options.add(newOne);
currentOffsetInHeader += newOne.length();
}
}