<commit_before>package org.teavm.classlib.java.nio;

import org.teavm.classlib.java.lang.TComparable;

/**
 *
 * @author <NAME>
 */
public abstract class TByteBuffer extends TBuffer implements TComparable<TByteBuffer> {
    int start;
    byte[] array;
    TByteOrder order = TByteOrder.BIG_ENDIAN;

    TByteBuffer(int start, int capacity, byte[] array, int offset, int length) {
        super(capacity);
        this.start = start;
        this.array = array;
        position = offset;
        limit = position + length;
    }

    public static TByteBuffer allocateDirect(int capacity) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity is negative: " + capacity);
        }
        return new TByteBufferImpl(capacity, true);
    }

    public static TByteBuffer allocate(int capacity) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity is negative: " + capacity);
        }
        return new TByteBufferImpl(capacity, false);
    }

    public static TByteBuffer wrap(byte[] array, int offset, int length) {
        return new TByteBufferImpl(0, array.length, array, offset, offset + length, false, false);
    }

    public static TByteBuffer wrap(byte[] array) {<commit_msg>Fixes some test of ByteBuffer<commit_after>package org.teavm.classlib.java.nio;

import org.teavm.classlib.java.lang.TComparable;

/**
 *
 * @author <NAME>
 */
public abstract class TByteBuffer extends TBuffer implements TComparable<TByteBuffer> {
    int start;
    byte[] array;
    TByteOrder order = TByteOrder.BIG_ENDIAN;

    TByteBuffer(int start, int capacity, byte[] array, int position, int limit) {
        super(capacity);
        this.start = start;
        this.array = array;
        this.position = position;
        this.limit = limit;
    }

    public static TByteBuffer allocateDirect(int capacity) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity is negative: " + capacity);
        }
        return new TByteBufferImpl(capacity, true);
    }

    public static TByteBuffer allocate(int capacity) {
        if (capacity < 0) {
            throw new IllegalArgumentException("Capacity is negative: " + capacity);
        }
        return new TByteBufferImpl(capacity, false);
    }

    public static TByteBuffer wrap(byte[] array, int offset, int length) {
        return new TByteBufferImpl(0, array.length, array, offset, offset + length, false, false);
    }

    public static TByteBuffer wrap(byte[] array) {
{'fraction_non_alphanumeric': 0.09695290858725762, 'fraction_numerical': 0.002374356944994064, 'mean_word_length': 2.8713629402756506, 'pattern_counts': {'":': 0, '<': 11, '<?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': '6543133', 'n_tokens_mistral': 711, 'n_tokens_neox': 694, 'n_words': 205}