1 package org.jgroups.util;2 3 import java.io.ByteArrayOutputStream ;4 5 /**6 * Extends ByteArrayOutputStream, but exposes the internal buffer. This way we don't need to call7 * toByteArray() which copies the internal buffer8 * @author Bela Ban9 * @version $Id: ExposedByteArrayOutputStream.java,v 1.1 2004/09/26 11:08:25 belaban Exp $10 */11 public class ExposedByteArrayOutputStream extends ByteArrayOutputStream {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