Design Pattern Question# JobHunting - 待字闺中
i*b
1 楼
anyone familiar with Decorator design pattern?
Java I/O is using this pattern. BufferedInputStream and DataInputStream
are all subclasses of FilterInputStream.
they are supposed to work fine when used in any order on an InputStream
This (1):
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
And this (2):
fis = new FileInputStream(file);
dis = new DataInputStream(bis);
bis = new Buffered
Java I/O is using this pattern. BufferedInputStream and DataInputStream
are all subclasses of FilterInputStream.
they are supposed to work fine when used in any order on an InputStream
This (1):
fis = new FileInputStream(file);
bis = new BufferedInputStream(fis);
dis = new DataInputStream(bis);
And this (2):
fis = new FileInputStream(file);
dis = new DataInputStream(bis);
bis = new Buffered