Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
就我们所见,FilterInputStream类扩展了InputStream类。这很简单,因为FilterInputStream实例“是一个”InputStream实例。但也有一个类型InputStream在FilterInputStream类中的字段,这意味着它InputStream是“一部分” FilterInputStream。他们同时使用了组合和继承。这个决定解决了什么样的问题?做什么的?它只是众所周知的模式吗?
FilterInputStream
InputStream