Skip to content

Commit d9b1e63

Browse files
committed
update for 1.0.0 release
1 parent d22e6fe commit d9b1e63

File tree

1 file changed

+13
-8
lines changed

1 file changed

+13
-8
lines changed

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@ It should be useful for systems that process large amounts of data, as a simple
55

66
# Documentation
77

8-
Checkout [project wiki](https://github.com/cowtowncoder/java-merge-sort/wiki) for more documentation, including javadocs.
8+
Checkout [project wiki](https://github.com/cowtowncoder/java-merge-sort/wiki) for more documentation, including Javadocs.
99

1010
# License
1111

12-
Library is licensed under Apache License 2.0.
12+
Library is licensed under [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0.txt).
1313

1414
# Usage
1515

@@ -28,26 +28,31 @@ Fortunately implementing your own readers and writers is trivial.
2828

2929
With a Sorter instance, you can call one of two main sort methods:
3030

31-
public void sort(InputStream source, OutputStream destination)
32-
public boolean sort(DataReader<T> inputReader, DataWriter<T> resultWriter)
31+
```java
32+
public void sort(InputStream source, OutputStream destination)
33+
public boolean sort(DataReader<T> inputReader, DataWriter<T> resultWriter)
34+
```
3335

3436
where former takes input as streams and uses configured reader/writer factories to construct `DataReader` for input and `DataWriter` for output; and latter just uses pre-constructed instances.
3537

3638
In addition to core sorting functionality, `Sorter` instance also gives access to progress information (it implements `SortingState` interface with accessor methods).
3739

3840
A very simple example of sorting a text file using line-by-line comparison is:
3941

40-
TextSorter sorter = new TextFileSorter(new SortConfig().withMaxMemoryUsage(20 * 1000 * 1000));
41-
sorter.sort(new FileInputStream("input.txt"),
42-
new FileOutputStream("output.txt"));
42+
```java
43+
TextSorter sorter = new TextFileSorter(new SortConfig().withMaxMemoryUsage(20 * 1000 * 1000));
44+
sorter.sort(new FileInputStream("input.txt"), new FileOutputStream("output.txt"));
45+
```
4346

4447
which would read text from file "input.txt", sort using about 20 megs of heap (note: estimates for memory usage are rough), use temporary files if necessary (i.e. for small files it's just in-memoryu sort, for bigger real merge sort), and write output as file "output.txt".
4548

4649
## Command-line utility
4750

4851
Project jar is packaged such that it can be used as a primitive 'sort' tool like so:
4952

50-
java -jar java-merge-sort-0.9.1.jar [input-file]
53+
```java
54+
java -jar java-merge-sort-1.0.0.jar [input-file]
55+
```
5156

5257
where sorted output gets printed to `stdout`; and argument is optional (if missing, reads input from stdout).
5358
(implementation note: this uses standard `TextFileSorter` mentioned above)

0 commit comments

Comments
 (0)