<commit_before>package com.minorityhobbies.util.ee.common;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

import com.fasterxml.jackson.core.JsonGenerationException;
import com.fasterxml.jackson.core.JsonParseException;
import com.fasterxml.jackson.databind.JsonMappingException;
import com.fasterxml.jackson.databind.ObjectMapper;

abstract class JacksonJsonMessageBodyProvider {
	private final ObjectMapper mapper = new ObjectMapper();

	public JacksonJsonMessageBodyProvider() {
		super();
	}
	
	protected final void writeValue(Object object, OutputStream stream)
			throws JsonGenerationException, JsonMappingException, IOException {
		mapper.writerWithDefaultPrettyPrinter().writeValue(stream, object);
	}
	
	protected final <T> T readValue(InputStream stream, Class<T> type)
			throws JsonParseException, JsonMappingException, IOException {
		return mapper.readValue(stream, type);
	}
}<commit_msg>Adding Java8 date/time serialisation<commit_after>package com.minorityhobbies.util.ee.common;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

abstract class JacksonJsonMessageBodyProvider {
	private final ObjectMapper mapper = new ObjectMapper();

	public JacksonJsonMessageBodyProvider() {
		super();
		mapper.registerModule(new JavaTimeModule());
	}
	
	protected final void writeValue(Object object, OutputStream stream)
			throws IOException {
		mapper.writerWithDefaultPrettyPrinter().writeValue(stream, object);
	}
	
	protected final <T> T readValue(InputStream stream, Class<T> type)
			throws IOException {
		return mapper.readValue(stream, type);
	}
}
{'fraction_non_alphanumeric': 0.08888888888888889, 'fraction_numerical': 0.002279202279202279, 'mean_word_length': 6.472340425531915, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, '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': '7491535', 'n_tokens_mistral': 528, 'n_tokens_neox': 470, 'n_words': 109}