Skip to content

Commit 04551ff

Browse files
committed
Some small fixes
1 parent 22df31d commit 04551ff

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,22 @@ To other collections
486486

487487
```java
488488
Bytes.wrap(array).toList(); // of type List<Byte>
489-
Bytes.wrap(array).toObjectArray(); // of type Byte[]
489+
Bytes.wrap(array).toBoxedArray(); // of type Byte[]
490490
Bytes.wrap(array).toBitSet(); //of type java.util.BitSet
491491
```
492492

493-
and to [`BigInteger`](https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html) of course:
493+
to [`BigInteger`](https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html) of course
494494

495495
```java
496496
Bytes.wrap(array).toBigInteger();
497497
```
498498

499+
and others
500+
501+
```java
502+
Bytes.wrap(array).toUUID(); // convert 16 byte to UUID
503+
```
504+
499505
### Mutable and Read-Only
500506

501507
Per default the instance is immutable, i.e. every transformation will create a

src/test/java/at/favre/lib/bytes/BytesToConvertOtherTypesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ private void checkArray(byte[] array) {
4545
for (int i = 0; i < array.length; i++) {
4646
assertEquals(byteArray[i], Byte.valueOf(array[i]));
4747
}
48+
assertArrayEquals(byteArray, Bytes.from(array).toObjectArray());
4849
}
4950

5051
@Test

0 commit comments

Comments
 (0)