public Dictionary<uint, IStream> FindByProtocolIdByType(uint protocolId, ulong type, bool partial) { var mask = partial ? type.GetTagMask() : 0xffffffffffffffffL; return FindByProtocolId(protocolId) .Where(x => (x.Value.Type & mask) == type) .ToDictionary(x => x.Key, x => x.Value); }