01: /*
02: * All content copyright (c) 2003-2006 Terracotta, Inc., except as may otherwise be noted in a separate copyright notice. All rights reserved.
03: */
04: package com.tc.process;
05:
06: import java.io.ByteArrayOutputStream;
07: import java.io.InputStream;
08:
09: /**
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 stream) {
15: super (stream, new ByteArrayOutputStream());
16: }
17:
18: public String toString() {
19: return new String(((ByteArrayOutputStream) this.out)
20: .toByteArray());
21: }
22:
23: }
|