public void Add(F2B_FWDATA_TYPE0_ENUM type, byte[] data) { int size = 0; if (!DataSize.TryGetValue(type, out size)) { throw new ArgumentException("Unable to add rule with unknown type size: " + type); } cachedHash = null; writer.Write((byte)type); writer.Write(data); }
public void Add(byte[] data) { if (data.Length == 0) { // skip empty data return; } int size = 0; F2B_FWDATA_TYPE0_ENUM type = (F2B_FWDATA_TYPE0_ENUM)data[0]; if (!DataSize.TryGetValue(type, out size)) { throw new ArgumentException("Unable to add rule with unknown type size: " + type); } cachedHash = null; writer.Write(data); }