<commit_before>package java.nio;

public class ByteBuffer {
  private final byte[] array;
  private int arrayOffset;
  private int capacity;
  private int position;
  private int limit;
  private final boolean readOnly;

  public static ByteBuffer allocate(int capacity) {
    return new ByteBuffer(new byte[capacity], false);
  }

  public static ByteBuffer wrap(byte[] array) {
    return new ByteBuffer(array, false);
  }

  private ByteBuffer(byte[] array, boolean readOnly) {
    this.array = array;
    this.readOnly = readOnly;
    arrayOffset = 0;
    capacity = array.length;
    limit = capacity;
    position = 0;
  }

  public byte[] array() {
    return array;<commit_msg>make ByteBuffer implement Comparable<commit_after>package java.nio;

public class ByteBuffer implements Comparable<ByteBuffer> {
  private final byte[] array;
  private int arrayOffset;
  private int capacity;
  private int position;
  private int limit;
  private final boolean readOnly;

  public static ByteBuffer allocate(int capacity) {
    return new ByteBuffer(new byte[capacity], false);
  }

  public static ByteBuffer wrap(byte[] array) {
    return new ByteBuffer(array, false);
  }

  private ByteBuffer(byte[] array, boolean readOnly) {
    this.array = array;
    this.readOnly = readOnly;
    arrayOffset = 0;
    capacity = array.length;
    limit = capacity;
    position = 0;
  }

  public int compareTo(ByteBuffer o) {
    int end = (remaining() < o.remaining() ? remaining() : o.remaining());

    for (int i = 0; i < end; ++i) {
      int d = get(position + i) - o.get(o.position + i);
      if (d != 0) {
        return d;
      }
    }
    return remaining() - o.remaining();
  }

  public boolean equals(Object o) {
    return o instanceof ByteBuffer && compareTo((ByteBuffer) o) == 0;
  }

  public byte[] array() {
    return array;
{'fraction_non_alphanumeric': 0.1058057514921324, 'fraction_numerical': 0.0037981551817688553, 'mean_word_length': 3.248847926267281, 'pattern_counts': {'":': 0, '<': 6, '<?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': '5155073', 'n_tokens_mistral': 558, 'n_tokens_neox': 538, 'n_words': 178}