Skip to content

Commit

Permalink
Fixed readme code example syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
bencampion committed Apr 3, 2016
1 parent 1aa0d3f commit d8cf83c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ These functions are automatically loaded when creating `BitWapper` instances. Ad

```java
Function<ByteBuffer, Instant> unixTime = buf -> Instant.ofEpochSecond(buf.getInt());
BitWrapper wrapper = BitWrapper.builder().addDecoder(Instance.class unixTime).build();
BitWrapper wrapper = BitWrapper.builder().addDecoder(Instance.class, unixTime).build();
```

New decoders can be created by composing existing decoders functions. The Unix timestamp decoder in the previous example could also be written like this:
Expand All @@ -144,7 +144,7 @@ The behaviour of the provided functions can be overridden by creating a new func

```java
Function<ByteBuffer, Instant> utf8 = new StringDecoder(StandardCharsets.UTF_8);
BitWrapper wrapper = BitWrapper.builder().addDecoder(String.class utf8).build();
BitWrapper wrapper = BitWrapper.builder().addDecoder(String.class, utf8).build();
```

## Under the hood
Expand Down

0 comments on commit d8cf83c

Please sign in to comment.