aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
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