<commit_before>package pl.grzeslowski.jsupla.protocol.encoders;

import static java.lang.String.format;
import static pl.grzeslowski.jsupla.protocol.consts.JavaConsts.BYTE_SIZE;
import static pl.grzeslowski.jsupla.protocol.consts.JavaConsts.INT_SIZE;

final class PrimitiveSerializer {

    public static void putUnsignedInt(int value, byte[] bytes, int offset) {
        if (bytes.length - offset < INT_SIZE) {
            throw new IllegalArgumentException(format("Bytes array has length %s and is not sufficient to put here int (%s) with offset %s",
                    bytes.length, INT_SIZE, offset));
        }

        value += Integer.MIN_VALUE;
        // https://stackoverflow.com/a/1936865/1819402
        for(int i = 0; i < INT_SIZE; i++) {
            bytes[offset + i] = (byte) (value >> (i * 8));
        }
    }

    public static void putUnsignedByte(byte value, byte[] bytes, int offset) {
        if (bytes.length - offset < BYTE_SIZE) {
            throw new IllegalArgumentException(format("Bytes array has length %s and is not sufficient to put here byte (%s) with offset %s",
                    bytes.length, BYTE_SIZE, offset));
        }
        bytes[offset] = value;
    }
}
<commit_msg>`Line is longer than 120 characters`<commit_after>package pl.grzeslowski.jsupla.protocol.encoders;

import static java.lang.String.format;
import static pl.grzeslowski.jsupla.protocol.consts.JavaConsts.BYTE_SIZE;
import static pl.grzeslowski.jsupla.protocol.consts.JavaConsts.INT_SIZE;

final class PrimitiveSerializer {

    public static void putUnsignedInt(int value, byte[] bytes, int offset) {
        if (bytes.length - offset < INT_SIZE) {
            throw new IllegalArgumentException(
                    format("Bytes array has length %s and is not sufficient to put here int (%s) with offset %s",
                    bytes.length, INT_SIZE, offset));
        }

        value += Integer.MIN_VALUE;
        // https://stackoverflow.com/a/1936865/1819402
        for(int i = 0; i < INT_SIZE; i++) {
            bytes[offset + i] = (byte) (value >> (i * 8));
        }
    }

    public static void putUnsignedByte(byte value, byte[] bytes, int offset) {
        if (bytes.length - offset < BYTE_SIZE) {
            throw new IllegalArgumentException(
                    format("Bytes array has length %s and is not sufficient to put here byte (%s) with offset %s",
                    bytes.length, BYTE_SIZE, offset));
        }
        bytes[offset] = value;
    }
}

{'fraction_non_alphanumeric': 0.10581162324649299, 'fraction_numerical': 0.014028056112224449, 'mean_word_length': 2.535410764872521, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '834590', 'n_tokens_mistral': 761, 'n_tokens_neox': 724, 'n_words': 209}