Skip to content

Commit 1c80b15

Browse files
committed
Update readme
1 parent 75432fa commit 1c80b15

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -172,13 +172,13 @@ Bytes result = Bytes.wrap(array1).append((byte) 3);
172172
**Bitwise operations**: XOR, OR, AND, NOT as well as left and right shifts and switching bits:
173173

174174
```java
175-
Bytes result = Bytes.wrap(array).xor(array2);
176-
Bytes result = Bytes.wrap(array).or(array2);
177-
Bytes result = Bytes.wrap(array).and(array2);
178-
Bytes result = Bytes.wrap(array).negate();
179-
Bytes result = Bytes.wrap(array).leftShift(8);
180-
Bytes result = Bytes.wrap(array).rightShift(8);
181-
Bytes result = Bytes.wrap(array).switchBit(3, true);
175+
Bytes.wrap(array).xor(array2);
176+
Bytes.wrap(array).or(array2);
177+
Bytes.wrap(array).and(array2);
178+
Bytes.wrap(array).negate();
179+
Bytes.wrap(array).leftShift(8);
180+
Bytes.wrap(array).rightShift(8);
181+
Bytes.wrap(array).switchBit(3, true);
182182
```
183183

184184
**Copy** operations, which copies the internal byte array to a new instance:
@@ -211,7 +211,7 @@ Bytes.wrap(array).transform(checksumCrc32());
211211
Bytes.wrap(array).transform(checksum(new Adler32(), ChecksumTransformer.Mode.TRANSFORM, 4));
212212
```
213213

214-
**GZip compression**:
214+
**GZip compression** is supported by [`GZIPInputStream`](https://docs.oracle.com/javase/7/docs/api/java/util/zip/GZIPInputStream.html):
215215

216216
```java
217217
import static at.favre.lib.bytes.BytesTransformers.*;
@@ -223,9 +223,9 @@ Bytes decompressed = compressed.transform(decompressGzip());
223223
Other transformers:
224224

225225
```java
226-
Bytes result = Bytes.wrap(array).shuffle();
227-
Bytes result = Bytes.wrap(array).sort(myComparator);
228-
Bytes result = Bytes.wrap(array).reverse();
226+
Bytes.wrap(array).shuffle();
227+
Bytes.wrap(array).sort(myComparator);
228+
Bytes.wrap(array).reverse();
229229
```
230230

231231
### Parser and Encoder for Binary-Text-Encodings
@@ -289,7 +289,7 @@ And others:
289289
```java
290290
Bytes.wrap(array).bitAt(4);
291291
Bytes.wrap(array).byteAt(14);
292-
Bytes.wrap(array).count(0x01); //occurrence of 0x01
292+
Bytes.wrap(array).count(0x01); //occurrences of 0x01
293293
Bytes.wrap(array).entropy();
294294
```
295295

@@ -310,13 +310,13 @@ A simple validation framework which can be used to check the internal byte array
310310
```java
311311
import static at.favre.lib.bytes.BytesValidators.*;
312312

313-
Bytes.wrap(new byte[]{8, 3, 9}.validate(startsWith((byte) 8), atLeast(3)); // true
313+
Bytes.wrap(new byte[]{8, 3, 9}).validate(startsWith((byte) 8), atLeast(3)); // true
314314
```
315315

316316
This is especially convenient when combining validators:
317317

318318
```java
319-
Bytes.wrap(new byte[]{0, 1}.validate(atMost(2), notOnlyOf((byte) 0)); // true
319+
Bytes.wrap(new byte[]{0, 1}).validate(atMost(2), notOnlyOf((byte) 0)); // true
320320
```
321321

322322
Validators also support nestable logical expressions AND, OR as well as NOT:

0 commit comments

Comments
 (0)