Skip to content

aalted/jblosc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

108 Commits
 
 
 
 
 
 
 
 

Repository files navigation

jblosc

Java interface for Blosc

The purpose of this project is to create a Java interface for the compressor Blosc. JNA has been chosen as the mechanism to communicate with the Blosc shared library.

A simple example extracted from the unit tests:

	int SIZE = 100 * 100 * 100;
	ByteBuffer ibb = ByteBuffer.allocateDirect(SIZE * PrimitiveSizes.DOUBLE_FIELD_SIZE);
	for (int i = 0; i < SIZE; i++) {
		ibb.putDouble(i);
	}
	BloscWrapper bw = new BloscWrapper();
	bw.init();
	ByteBuffer obb = ByteBuffer.allocateDirect(ibb.limit() + BloscWrapper.OVERHEAD);
	bw.compress(5, Shuffle.BYTE_SHUFFLE, PrimitiveSizes.DOUBLE_FIELD_SIZE, ibb, ibb.limit(), obb, obb.limit());
	ByteBuffer abb = ByteBuffer.allocateDirect(ibb.limit());
	bw.decompress(obb, abb, abb.limit());
	bw.destroy();
	assertEquals(ibb, abb);

Blosc shared library should be on PATH on Windows or in LD_LIBRARY_PATH on Linux/Unix.

Build: mvn clean install

About

Java interface for blosc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages