<commit_before>package com.mindoo.domino.jna.test;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;

import org.junit.Assert;
import org.junit.Test;

import com.mindoo.domino.jna.errors.NotesErrorUtils;
import com.mindoo.domino.jna.internal.DisposableMemory;
import com.mindoo.domino.jna.internal.NotesNativeAPI32;
import com.mindoo.domino.jna.internal.NotesNativeAPI64;
import com.mindoo.domino.jna.utils.DumpUtil;
import com.mindoo.domino.jna.utils.LZ1CompressOutputStream;
import com.mindoo.domino.jna.utils.LZ1Decompress;
import com.mindoo.domino.jna.utils.PlatformUtils;

import lotus.domino.Session;

/**
 * Tests compression and decompression using LZ1 algorithm
 * 
 * @author <NAME>
 */
public class TestLZ1Compression extends BaseJNATestClass {

	@Test
	public void testCompression() {
		runWithSession(new IDominoCallable<Object>() {

			@Override
			public Object call(Session session) throws Exception {
				int uncompressedRandomDataSize = 500000;
				System.out.println("Generating input data for compression ("+uncompressedRandomDataSize+" bytes)");
				
				byte[] uncompressedRandomData = new byte[uncompressedRandomDataSize];
//				int x=0;
				for (int i=0; i<uncompressedRandomData.length; i++) {
//					uncompressedRandomData[i] = (byte) (Math.random()*255);
//					uncompressedRandomData[i] = (byte) (x & 0xff);
					uncompressedRandomData[i] = (byte) (i % 4);
//					if ((i % 20) == 0)
//						x++;
				}
				
				ByteArrayOutputStream bOut = new ByteArrayOutputStream();<commit_msg>Removed unused import<commit_after>package com.mindoo.domino.jna.test;

import java.io.ByteArrayOutputStream;
import java.nio.ByteBuffer;

import org.junit.Assert;
import org.junit.Test;

import com.mindoo.domino.jna.errors.NotesErrorUtils;
import com.mindoo.domino.jna.internal.DisposableMemory;
import com.mindoo.domino.jna.internal.NotesNativeAPI32;
import com.mindoo.domino.jna.internal.NotesNativeAPI64;
import com.mindoo.domino.jna.utils.DumpUtil;
import com.mindoo.domino.jna.utils.LZ1CompressOutputStream;
import com.mindoo.domino.jna.utils.PlatformUtils;

import lotus.domino.Session;

/**
 * Tests compression and decompression using LZ1 algorithm
 * 
 * @author <NAME>
 */
public class TestLZ1Compression extends BaseJNATestClass {

	@Test
	public void testCompression() {
		runWithSession(new IDominoCallable<Object>() {

			@Override
			public Object call(Session session) throws Exception {
				int uncompressedRandomDataSize = 500000;
				System.out.println("Generating input data for compression ("+uncompressedRandomDataSize+" bytes)");
				
				byte[] uncompressedRandomData = new byte[uncompressedRandomDataSize];
//				int x=0;
				for (int i=0; i<uncompressedRandomData.length; i++) {
//					uncompressedRandomData[i] = (byte) (Math.random()*255);
//					uncompressedRandomData[i] = (byte) (x & 0xff);
					uncompressedRandomData[i] = (byte) (i % 4);
//					if ((i % 20) == 0)
//						x++;
				}
				
				ByteArrayOutputStream bOut = new ByteArrayOutputStream();
{'fraction_non_alphanumeric': 0.12101063829787234, 'fraction_numerical': 0.015625, 'mean_word_length': 4.572222222222222, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 7, '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': '5833971', 'n_tokens_mistral': 1141, 'n_tokens_neox': 994, 'n_words': 191}