<commit_before>package de.crysxd.ownfx;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonSupport {
	
	public static Gson createGson() {
		GsonBuilder gsonBuilder = new GsonBuilder();
		gsonBuilder.registerTypeAdapter(ColorStop.class, new ColorStop.JsonDeserializer());
		gsonBuilder.registerTypeAdapter(ColorStop.class, new ColorStop.JsonSerializer());
		
		return gsonBuilder.create();
		
	}
}<commit_msg>Added methods to parse any type<commit_after>package de.crysxd.ownfx;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;

public class GsonSupport {
	
	public static Gson createGson() {
		GsonBuilder gsonBuilder = new GsonBuilder();
		gsonBuilder.registerTypeAdapter(ColorStop.class, new ColorStop.JsonDeserializer());
		gsonBuilder.registerTypeAdapter(ColorStop.class, new ColorStop.JsonSerializer());
		
		return gsonBuilder.create();
		
	}
	
	public static <T> T parse(String json, Class<T> outputClass) {
		return GsonSupport.createGson().fromJson(json, outputClass);
		
	}
	
	public static <T> T parse(InputStream jsonStream, Class<T> outputClass) throws IOException {
		return GsonSupport.<T>parse(GsonSupport.readStream(jsonStream), outputClass);
		
	}
	
	private static String readStream(InputStream in) throws IOException {
		BufferedReader inReader = new BufferedReader(new InputStreamReader(in));
		StringBuilder readContent = new StringBuilder();
		String line;
		
		try {
			while((line = inReader.readLine()) != null) {
				readContent.append(line);
				readContent.append("\n");
				
			}	
		} finally {
			inReader.close();
	
		}
		
		return readContent.toString();
		
	}
}
{'fraction_non_alphanumeric': 0.10752688172043011, 'fraction_numerical': 0.0, 'mean_word_length': 4.913043478260869, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 8, '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': '6422021', 'n_tokens_mistral': 600, 'n_tokens_neox': 532, 'n_words': 115}