01: package org.jgroups.util;
02:
03: import java.io.BufferedOutputStream;
04: import java.io.OutputStream;
05:
06: /**
07: * @author Bela Ban
08: * @version $Id: ExposedBufferedOutputStream.java,v 1.1 2005/07/25 15:53:36 belaban Exp $
09: */
10: public class ExposedBufferedOutputStream extends BufferedOutputStream {
11: /**
12: * Creates a new buffered output stream to write data to the
13: * specified underlying output stream.
14: *
15: * @param out the underlying output stream.
16: */
17: public ExposedBufferedOutputStream(OutputStream out) {
18: super (out);
19: }
20:
21: /**
22: * Creates a new buffered output stream to write data to the
23: * specified underlying output stream with the specified buffer
24: * size.
25: *
26: * @param out the underlying output stream.
27: * @param size the buffer size.
28: * @throws IllegalArgumentException if size <= 0.
29: */
30: public ExposedBufferedOutputStream(OutputStream out, int size) {
31: super (out, size);
32: }
33:
34: public void reset(int size) {
35: count = 0;
36: if (size > buf.length) {
37: buf = new byte[size];
38: }
39: }
40: }
|