Skip to content

Commit 31b84c7

Browse files
committed
README updates.
1 parent 79fcb5e commit 31b84c7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,16 @@ AsciiCompressor compressor = new SixBitAsciiCompressor();
6060
```
6161

6262
#### Defining your custom character set
63-
Each compressor have a set of default supported characters which are defined in fields `DEFAULT_4BIT_CHARSET`, `DEFAULT_5BIT_CHARSET`, and `DEFAULT_6BIT_CHARSET`.
63+
Each compressor have a set of default supported characters which are defined in fields
64+
`FourBitAsciiCompressor.DEFAULT_4BIT_CHARSET`, `FiveBitAsciiCompressor.DEFAULT_5BIT_CHARSET`, and `SixBitAsciiCompressor.DEFAULT_6BIT_CHARSET`.
6465
If you need a custom character set, use constructors with parameter `supportedCharset`:
6566
```java
6667
// Follows ASCII character ordering.
6768
byte[] myCustom4BitCharset = {'!', '"', '#', '$', '%', '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', '@'};
6869
AsciiCompressor compressor = new FourBitAsciiCompressor(myCustom4BitCharset);
6970
```
71+
**Important:** The order in which you list characters in this array matters, as it defines the lexicographic
72+
order the binary search will follow. It's good practice to define your custom charset in standard ASCII order, like the example above.
7073

7174
#### Catching invalid characters (useful for testing an debugging)
7275
It’s useful to validate the input and throw errors when invalid characters are found.

0 commit comments

Comments
 (0)