aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-12-14 19:29:26 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-12-14 19:29:26 +0100
commit35f7a20b22271f8f28d15da8df85cff2fc9cd716 (patch)
tree496e011fd0cf8c34d2634ce991f287b6a4ee4838 /README.md
parent4c32c3998476e12c34984d52253eaa4ae3bf6769 (diff)
Simplify types, replace Value with Variant.
Change-Id: I2e492ebfefc7e9a47c874ed22ff199412e9948ee
Diffstat (limited to 'README.md')
-rw-r--r--README.md8
1 files changed, 4 insertions, 4 deletions
diff --git a/README.md b/README.md
index e482857..dead043 100644
--- a/README.md
+++ b/README.md
@@ -24,17 +24,17 @@ serialization][] specification.
To parse a [GVariant][] value of type `"a(si)"`, which is an array of
pairs of [String][] and `int`, you can use the following code:
- record ExampleRecord(Value.Str s, Value.Int32 i) {}
+ record ExampleRecord(String s, int i) {}
var decoder =
Decoder.ofArray(
Decoder.ofStructure(
ExampleRecord.class,
- Decoder.ofStr(StandardCharsets.UTF_8),
- Decoder.ofInt32().withByteOrder(ByteOrder.LITTLE_ENDIAN)));
+ Decoder.ofString(StandardCharsets.UTF_8),
+ Decoder.ofInt().withByteOrder(ByteOrder.LITTLE_ENDIAN)));
byte[] bytes = ...;
- Value.Array<Value.Structure<ExampleRecord>> example = decoder.decode(bytes);
+ List<ExampleRecord> example = decoder.decode(ByteBuffer.wrap(bytes));
[ByteBuffer]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html