본문 바로가기

JAVA /IO & NIO

SequencInputStream , OutputStream

 

SequencInputStream  은.. 여러개의 InputStream 을 연결 할 수 있다.

여러개를 연결하여, 한번의 연산으로, 처리 할 수 있음 ...

여러개의파일을 연결할때는.. 벡터에 addElement 하고.

Enumeration 에, 벡터의 elements 를 뽑아내어서, 매개변수로 넘겨주면 댄당.

예)

Vector vc = new Vector();

vc.addElements(new FileInputStream(new File("aaa.txt")));

vc.addElements(new FileInputStream(new File("aaa1.txt")));

vc.addElements(new FileInputStream(new File("aaa2.txt")));

한 다음. Enumeration en = vc.elements();

하여, 벡터에서 스트림을 뽑아내어 new SequenceInputStream(en) < 매개변수로 넘겨주면. 한번의 연산으로 처리할 수 있음

 

'JAVA > IO & NIO' 카테고리의 다른 글

MappedByteBuffer !  (0) 2013.03.03
NIO , Channel , Charset Packages !  (0) 2013.03.03
NIO 의 기본 구성  (0) 2013.03.03
PipedOutputStream & InputStream  (0) 2013.03.03
ByteArrayOutputStream & InputStream  (0) 2013.03.03