<commit_before>package org.jgroups.util;

import java.io.ByteArrayOutputStream;

/**
 * Extends ByteArrayOutputStream, but exposes the internal buffer. This way we don't need to call
 * toByteArray() which copies the internal buffer
 * @author <NAME>
 * @version $Id: ExposedByteArrayOutputStream.java,v 1.2 2005/07/25 15:53:36 belaban Exp $
 */
public class ExposedByteArrayOutputStream extends ByteArrayOutputStream {

    public ExposedByteArrayOutputStream() {
    }

    public ExposedByteArrayOutputStream(int size) {
        super(size);
    }
<commit_msg>added reset() method (http://jira.jboss.com/jira/browse/JGRP-725)<commit_after>package org.jgroups.util;

import java.io.ByteArrayOutputStream;

/**
 * Extends ByteArrayOutputStream, but exposes the internal buffer. This way we don't need to call
 * toByteArray() which copies the internal buffer
 * @author <NAME>
 * @version $Id: ExposedByteArrayOutputStream.java,v 1.3 2008/03/27 11:16:15 belaban Exp $
 */
public class ExposedByteArrayOutputStream extends ByteArrayOutputStream {

    public ExposedByteArrayOutputStream() {
        super();
    }

    public ExposedByteArrayOutputStream(int size) {
        super(size);
    }

    /** Resets count and creates a new buf if the current buf is > max_size. This method is not synchronized */
    public void reset(int max_size) {
        super.reset();
        if(buf.length > max_size) {
            buf=new byte[max_size];
        }
    }

{'fraction_non_alphanumeric': 0.09540150995195608, 'fraction_numerical': 0.024021962937542895, 'mean_word_length': 3.673076923076923, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6076063', 'n_tokens_mistral': 449, 'n_tokens_neox': 411, 'n_words': 121}