<commit_before>package jocket.impl;

import java.io.IOException;
import java.io.OutputStream;

import jocket.wait.BusyYieldSleep;
import jocket.wait.WaitStrategy;

public class JocketOutputStream extends OutputStream {

	private final JocketWriter writer;
	private final WaitStrategy wait;

	public JocketOutputStream(JocketWriter writer, WaitStrategy wait) {
		this.writer = writer;
		this.wait = wait;
	}

	public JocketOutputStream(JocketWriter writer) {
		this(writer, new BusyYieldSleep());
	}

	@Override
	public void write(int b) throws IOException {
		write(new byte[] { (byte) b }, 0, 1);
	}

	@Override
	public void write(byte[] b, int off, int len) throws IOException {
		while (len > 0) {
			len -= writer.write(b, off, len);
			if (len > 0)
				wait.pause();
		}<commit_msg>reset waiter after successful write<commit_after>package jocket.impl;

import java.io.IOException;
import java.io.OutputStream;

import jocket.wait.BusyYieldSleep;
import jocket.wait.WaitStrategy;

public class JocketOutputStream extends OutputStream {

	private final JocketWriter writer;
	private final WaitStrategy wait;

	public JocketOutputStream(JocketWriter writer, WaitStrategy wait) {
		this.writer = writer;
		this.wait = wait;
	}

	public JocketOutputStream(JocketWriter writer) {
		this(writer, new BusyYieldSleep());
	}

	@Override
	public void write(int b) throws IOException {
		write(new byte[] { (byte) b }, 0, 1);
	}

	@Override
	public void write(byte[] b, int off, int len) throws IOException {
		while (len > 0) {
			len -= writer.write(b, off, len);
			if (len > 0)
				wait.pause();
		}
		wait.reset();
{'fraction_non_alphanumeric': 0.10794044665012408, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 4.430976430976431, 'pattern_counts': {'":': 0, '<': 3, '<?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': '3419220', 'n_tokens_mistral': 555, 'n_tokens_neox': 503, 'n_words': 151}