KickJava   Java API By Example, From Geeks To Geeks.

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


1 package org.jgroups.util;
2
3 import java.io.ByteArrayOutputStream JavaDoc;
4
5 /**
6  * Extends ByteArrayOutputStream, but exposes the internal buffer. This way we don't need to call
7  * toByteArray() which copies the internal buffer
8  * @author Bela Ban
9  * @version $Id: ExposedByteArrayOutputStream.java,v 1.1 2004/09/26 11:08:25 belaban Exp $
10  */

11 public class ExposedByteArrayOutputStream extends ByteArrayOutputStream JavaDoc {
12
13     public ExposedByteArrayOutputStream() {
14     }
15
16     public ExposedByteArrayOutputStream(int size) {
17         super(size);
18     }
19
20     public byte[] getRawBuffer() {
21         return buf;
22     }
23 }
24
Popular Tags