Skip to content

catenamatteo/groupvarint

Repository files navigation

groupvarint

A Java implementation of Group Varint, a technique for the compression of integer numbers.

Usage

int a[] = {1, 2, 3, 4, 5, 6, 7};
byte b[] = new byte[GroupVarint.getCompressedSize(a.length)];
int c[] = new int[a.length];

GroupVarint.compress(a, 0, a.length, b, 0);
GroupVarint.decompress(b, 0, c, 0, a.length);

with negative numbers:

int a[] = {0, 1, 2, -1, -2, Integer.MAX_VALUE, Integer.MIN_VALUE};
byte b[] = new byte[GroupVarint.getCompressedSize(a.length)];
int c[] = new int[a.length];
int support[] = Arrays.copyOf(a, a.length);

ZigZagGroupVarint.compress(support, 0, support.length, b, 0);
ZigZagGroupVarint.decompress(b, 0, c, 0, a.length);

Dependencies

  • JUnit 4

References

About

groupvarint: integer compression

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages