KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jgroups > util > ExposedBufferedOutputStream


1 package org.jgroups.util;
2
3 import java.io.BufferedOutputStream JavaDoc;
4 import java.io.OutputStream JavaDoc;
5
6 /**
7  * @author Bela Ban
8  * @version $Id: ExposedBufferedOutputStream.java,v 1.1 2005/07/25 15:53:36 belaban Exp $
9  */

10 public class ExposedBufferedOutputStream extends BufferedOutputStream JavaDoc {
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 JavaDoc 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 JavaDoc 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 }
41
Popular Tags