<commit_before>package pw.koj.jetstreem.core;

import java.nio.ByteBuffer;
import java.nio.channels.SelectableChannel;

public class ChannelReadBuffer {
    private static final int BUF_SIZE = 4096;
    private SelectableChannel ch;
    private ByteBuffer buf;

    public ChannelReadBuffer(SelectableChannel ch) {
        this.ch = ch;
        this.buf = ByteBuffer.allocateDirect(BUF_SIZE);
    }

    public SelectableChannel ch() {
        return this.ch;
    }

    public ByteBuffer buf() {
        return this.buf;
    }
}

<commit_msg>modify member type SelectableChannel to Channel and add some methods in class ChannelReadBuffer<commit_after>package pw.koj.jetstreem.core;

import java.nio.ByteBuffer;
import java.nio.channels.Channel;
import java.nio.channels.ReadableByteChannel;
import java.io.IOException;

public class ChannelReadBuffer {
    private static final int BUF_SIZE = 4096;
    private Channel ch;
    private ByteBuffer buf;

    public ChannelReadBuffer(Channel ch) {
        this.ch = ch;
        this.buf = ByteBuffer.allocateDirect(BUF_SIZE);
    }

    public Channel ch() {
        return this.ch;
    }

    public ByteBuffer buf() {
        return this.buf;
    }

    public int read() throws IOException {
        ReadableByteChannel c = (ReadableByteChannel)this.ch;
        return c.read(this.buf);
    }

    public boolean isRemaining() {
        return this.buf.limit() > 0;
    }

}


{'fraction_non_alphanumeric': 0.08479327259985985, 'fraction_numerical': 0.006306937631394534, 'mean_word_length': 2.923076923076923, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 4, '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': '2640903', 'n_tokens_mistral': 436, 'n_tokens_neox': 417, 'n_words': 108}