<commit_before>package org.lightmare.utils.serialization;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.lightmare.utils.IOUtils;

/**
 * Reads write java objects from {@link Byte} array with java native
 * serialization
 * 
 * @author Levan
 * 
 */
public abstract class NativeSerializer {

    /**
     * Serializes java type ({@link Object}) to byte array with java native
     * serialization api
     * 
     * @param value
     * @return byte[]
     * @throws IOException
     */
    public static byte[] serialize(Object value) throws IOException {

	byte[] data;

	ByteArrayOutputStream stream = new ByteArrayOutputStream();
	ObjectOutputStream objectStream = new ObjectOutputStream(stream);

	try {
	    objectStream.writeObject(value);
	    data = stream.toByteArray();<commit_msg>commented / improved/ edited utility classes<commit_after>package org.lightmare.utils.serialization;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;

import org.lightmare.utils.IOUtils;

/**
 * Reads write java objects from {@link Byte} array with java native
 * serialization
 * 
 * @author Levan
 * 
 */
public abstract class NativeSerializer {

    /**
     * Serializes java type ({@link Object}) to byte array with java native
     * serialization API
     * 
     * @param value
     * @return byte[]
     * @throws IOException
     */
    public static byte[] serialize(Object value) throws IOException {

	byte[] data;

	ByteArrayOutputStream stream = new ByteArrayOutputStream();
	ObjectOutputStream objectStream = new ObjectOutputStream(stream);

	try {
	    objectStream.writeObject(value);
	    data = stream.toByteArray();
{'fraction_non_alphanumeric': 0.09422975119110641, 'fraction_numerical': 0.0, 'mean_word_length': 3.9476439790575917, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '4154983', 'n_tokens_mistral': 512, 'n_tokens_neox': 497, 'n_words': 147}