internal static IpV4OptionTimestampOnly Read(byte overflow, byte pointedIndex, byte[] buffer, ref int offset, int numValues) { IpV4TimeOfDay[] ipV4TimeOfDayArray = new IpV4TimeOfDay[numValues]; for (int index = 0; index != numValues; ++index) { ipV4TimeOfDayArray[index] = ByteArrayExtensions.ReadIpV4TimeOfDay(buffer, ref offset, Endianity.Big); } return(new IpV4OptionTimestampOnly(overflow, pointedIndex, ipV4TimeOfDayArray)); }
internal static IpV4OptionTimestampAndAddress Read(IpV4OptionTimestampType timestampType, byte overflow, byte pointedIndex, byte[] buffer, ref int offset, int numValues) { if (numValues % 2 != 0) { return((IpV4OptionTimestampAndAddress)null); } IpV4OptionTimedAddress[] optionTimedAddressArray = new IpV4OptionTimedAddress[numValues / 2]; for (int index = 0; index != numValues / 2; ++index) { optionTimedAddressArray[index] = new IpV4OptionTimedAddress(ByteArrayExtensions.ReadIpV4Address(buffer, ref offset, Endianity.Big), ByteArrayExtensions.ReadIpV4TimeOfDay(buffer, ref offset, Endianity.Big)); } return(new IpV4OptionTimestampAndAddress(timestampType, overflow, pointedIndex, optionTimedAddressArray)); }