KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > tc > process > StreamCollector


1 /*
2  * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
3  */

4 package com.tc.process;
5
6 import java.io.ByteArrayOutputStream JavaDoc;
7 import java.io.InputStream JavaDoc;
8
9 /**
10  * An object that reads a stream asynchronously and collects it into a data buffer.
11  */

12 public class StreamCollector extends StreamCopier {
13   
14   public StreamCollector(InputStream JavaDoc stream) {
15     super(stream, new ByteArrayOutputStream JavaDoc());
16   }
17   
18   public String JavaDoc toString() {
19     return new String JavaDoc(((ByteArrayOutputStream JavaDoc) this.out).toByteArray());
20   }
21
22 }
23
Popular Tags