Skip to content

Commit

Permalink
Fix wording
Browse files Browse the repository at this point in the history
  • Loading branch information
xerial committed Jan 24, 2017
1 parent 7c34e63 commit def87d8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ snappy-java is a Java port of the snappy
* JNI-based implementation to achieve comparable performance to the native C++ version.
* Although snappy-java uses JNI, it can be used safely with multiple class loaders (e.g. Tomcat, etc.).
* Compression/decompression of Java primitive arrays (`float[]`, `double[]`, `int[]`, `short[]`, `long[]`, etc.)
* To improve the compression ratios of these arrays, you can use a fast data-rearrangement implementation ([`BitShuffle`](http://static.javadoc.io/org.xerial.snappy/snappy-java/1.1.3-M1/org/xerial/snappy/BitShuffle.html)) before compression
* To improve the compression ratios of these arrays, you can use a fast data-rearrangement implementation ([`BitShuffle`](https://oss.sonatype.org/service/local/repositories/releases/archive/org/xerial/snappy/snappy-java/1.1.3-M1/snappy-java-1.1.3-M1-javadoc.jar/!/org/xerial/snappy/BitShuffle.html)) before compression
* Portable across various operating systems; Snappy-java contains native libraries built for Window/Mac/Linux (64-bit). snappy-java loads one of these libraries according to your machine environment (It looks system properties, `os.name` and `os.arch`).
* Simple usage. Add the snappy-java-(version).jar file to your classpath. Then call compression/decompression methods in `org.xerial.snappy.Snappy`.
* [Framing-format support](https://github.com/google/snappy/blob/master/framing_format.txt) (Since 1.1.0 version)
Expand Down Expand Up @@ -90,15 +90,11 @@ Stream-based compressor/decompressor `SnappyOutputStream`/`SnappyInputStream` ar
| `SnappyFramedOutputStream` | x | x | ok |

### BitShuffle API
To use BitShuffle routines, you need to import `org.xerial.snapy.BitShuffle` in your Java code:
BitShuffle is an algorithm that reorders data bits (shuffle) for efficient compression (e.g., a sequence of integers, float values, etc.). To use BitShuffle routines, import `org.xerial.snapy.BitShuffle`:

```java
import org.xerial.snappy.BitShuffle;
```

Then use them like this:

```java
int[] data = new int[] {1, 3, 34, 43, 34};
byte[] shuffledByteArray = BitShuffle.bitShuffle(data);
byte[] compressed = Snappy.compress(shuffledByteArray);
Expand All @@ -108,8 +104,7 @@ int[] result = BitShuffle.bitUnShuffleIntArray(uncompress);
System.out.println(result);
```

You can also shuffle and unshuffle the other primitive arrays (`short[]`, `long[]`, `float[]`, and `double[]`) and
the other routines can be found in [Javadoc](http://static.javadoc.io/org.xerial.snappy/snappy-java/1.1.3-M1/org/xerial/snappy/BitShuffle.html).
Shuffling and unshuffling of primitive arrays (e.g., `short[]`, `long[]`, `float[]`, `double[]`, etc.) are supported. See [Javadoc](http://static.javadoc.io/org.xerial.snappy/snappy-java/1.1.3-M1/org/xerial/snappy/BitShuffle.html) for the details.

### Setting classpath
If you have snappy-java-(VERSION).jar in the current directory, use `-classpath` option as follows:
Expand Down

0 comments on commit def87d8

Please sign in to comment.