简体   繁体   English

是否存在由各种cli流实现的接口类型?

[英]Is there an interface type that is implemented by various cli streams?

I was writing some support functions for MemoryStream but i figured that since the same methods would also work for FileStream and NetworkStream, I might as well set the argument type to an interface that I assume all of these share. 我正在为MemoryStream编写一些支持功能,但我发现由于相同的方法也适用于FileStream和NetworkStream,因此最好将参数类型设置为我假定所有这些共享的接口。 I couldn't find out what that interface is called though. 我找不到那个接口叫什么。 IStream from System.Runtime.InteropServices.ComTypes appears to be something else. System.Runtime.InteropServices.ComTypes的IStream似乎是另外一回事。

它们没有实现相同的接口,但是它们都继承了抽象的System.IO.Stream类。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 具有接口列表的接口,如何选择由接口实现的一种类型 - Interface with a list of interface, how to choose one type implemented by interface 在编译时检查接口是否由类型实现 - Check if a interface is implemented by a type in compile time C#函数返回类型的已实现接口 - C# function to return the implemented interface of a type 实现的方法的返回类型接口,Ienumerator - Return type interface for the method implemented, Ienumerator 返回派生类型时,“未实现接口” - “Interface not implemented” when Returning Derived Type 具有接口类型的键的字典,获取实现接口的键 - Dictionary with a key of interface type, get keys where interface is implemented 为什么不能使用持有实现接口的具体类型的属性来实现持有接口类型的接口属性? - Why can interface properties holding an interface type not be implemented with a property holding a concrete type that implements the interface? cli接口,其值类型为return和C#接口实现 - cli interface with value type as return and C# interface implementation TypeMatchingRule XML配置解析类类型而不是已实现的接口 - TypeMatchingRule XML configuration resolves the class type instead of implemented interface 如何限制仅由通用类型实现的接口 - How can I restrict an Interface to be implemented by only a generic type
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM