Based on Snappy in Java.