Skip to content

Commit 3e997a5

Browse files
committed
Add more to readme
1 parent 5aaa95f commit 3e997a5

File tree

2 files changed

+41
-2
lines changed

2 files changed

+41
-2
lines changed

CHANGELOG

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
# Releases
22

33
## v0.4.0
4+
* logical expressions in validators
5+
* more validators
46

57
## v0.3.1
68

README.md

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,47 @@
1-
# Bytes Java
1+
# Bytes
2+
3+
Bytes is a utility library that makes it easy to **create**, **parse**, **transform**,
4+
**validate** and **convert** byte arrays in Java. It's main class `Bytes` is
5+
a collections of bytes and the main API. It supports [endianness](https://en.wikipedia.org/wiki/Endianness)
6+
as well as **immutability** and **mutability**, so the caller may decide to favor
7+
performance. This can be seen as combination of the features provided by
8+
[`BigInteger`](https://docs.oracle.com/javase/7/docs/api/java/math/BigInteger.html),
9+
[`ByteBuffer`](https://docs.oracle.com/javase/7/docs/api/java/nio/ByteBuffer.html) but
10+
providing a lot of additional features.
211

312
[![Download](https://api.bintray.com/packages/patrickfav/maven/bytes-java/images/download.svg)](https://bintray.com/patrickfav/maven/bytes-java/_latestVersion)
413
[![Build Status](https://travis-ci.org/patrickfav/bytes-java.svg?branch=master)](https://travis-ci.org/patrickfav/bytes-java)
514
[![Javadocs](https://www.javadoc.io/badge/at.favre.lib/bytes.svg)](https://www.javadoc.io/doc/at.favre.lib/bytes)
615
[![Coverage Status](https://coveralls.io/repos/github/patrickfav/bytes-java/badge.svg?branch=master)](https://coveralls.io/github/patrickfav/bytes-java?branch=master)
716

17+
It's main features include:
18+
19+
* **Creation** from a wide variety of sources: multiple arrays, integers, streams, random, files, ...
20+
* **Transformation** with many built-in: append, xor, and, or, shifts, shuffle, reverse, sort, ...
21+
* **Validators** with the ability to arbitrarily combine multiple ones
22+
* **Parsing and Encoding** in most common binary-to-text-encodings: [hex](https://en.wikipedia.org/wiki/Hexadecimal), [base64](https://en.wikipedia.org/wiki/Base64), ...
23+
* **Immutable, Mutable and Read-Only** versions
24+
* **Utility Features** like `indexOf`, `count`, `isEmpty`, `byteAt`, ...
25+
26+
It is written in Java 7 to keep backwards compatibility with *Android* and older *Java* applications.
27+
28+
## Quickstart
29+
30+
Add dependency to your `pom.xml`:
31+
32+
<dependency>
33+
<groupId>at.favre.lib</groupId>
34+
<artifactId>bytes</artifactId>
35+
<version>{latest-version}</version>
36+
</dependency>
37+
38+
A very simple example:
39+
40+
```java
41+
Bytes b = Bytes.wrap(someByteArray); //reuse given reference
42+
b.copy().reverse(); //reverse the bytes on a copied instance
43+
String hex = b.encodeHex(); //encode base16/hex
44+
```
845

946
## API Description
1047

@@ -41,7 +78,7 @@ The following code is equivalent:
4178
Bytes.wrap(myArray).copy() ~ Bytes.from(myArray)
4279
```
4380

44-
### More Constructors
81+
#### More Constructors
4582

4683
**Concatenating** of multiple byte arrays or bytes:
4784

0 commit comments

Comments
 (0)