<commit_before>package com.janosgyerik.dupfinder.dupfinder;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Comparator;

public class FileContentComparator implements Comparator<File> {

    private static final int BUFSIZE = 4096;

    @Override
    public int compare(File file1, File file2) {
        int cmpFileSize = Long.compare(file1.length(), file2.length());
        if (cmpFileSize != 0) {
            return cmpFileSize;
        }

        if (file1.length() == 0) {
            return 0;
        }

        byte[] buffer1 = new byte[BUFSIZE];
        byte[] buffer2 = new byte[BUFSIZE];

        try (BufferedInputStream stream1 = new BufferedInputStream(new FileInputStream(file1));
             BufferedInputStream stream2 = new BufferedInputStream(new FileInputStream(file2))) {
            int bytesRead1;
            int bytesRead2;

            while (true) {<commit_msg>made bufsize a constructor param<commit_after>package com.janosgyerik.dupfinder.dupfinder;

import java.io.BufferedInputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.Comparator;

public class FileContentComparator implements Comparator<File> {

    private static final int DEFAULT_BUFSIZE = 4096;
    private final int bufSize;

    public FileContentComparator() {
        bufSize = DEFAULT_BUFSIZE;
    }

    public FileContentComparator(int bufSize) {
        this.bufSize = bufSize;
    }

    @Override
    public int compare(File file1, File file2) {
        int cmpFileSize = Long.compare(file1.length(), file2.length());
        if (cmpFileSize != 0) {
            return cmpFileSize;
        }

        if (file1.length() == 0) {
            return 0;
        }

        byte[] buffer1 = new byte[bufSize];
        byte[] buffer2 = new byte[bufSize];

        try (BufferedInputStream stream1 = new BufferedInputStream(new FileInputStream(file1));
             BufferedInputStream stream2 = new BufferedInputStream(new FileInputStream(file2))) {
            int bytesRead1;
            int bytesRead2;

            while (true) {
{'fraction_non_alphanumeric': 0.09099264705882353, 'fraction_numerical': 0.01838235294117647, 'mean_word_length': 2.75993091537133, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1091613', 'n_tokens_mistral': 623, 'n_tokens_neox': 602, 'n_words': 155}