From 35f7a20b22271f8f28d15da8df85cff2fc9cd716 Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Tue, 14 Dec 2021 19:29:26 +0100 Subject: Simplify types, replace Value with Variant. Change-Id: I2e492ebfefc7e9a47c874ed22ff199412e9948ee --- README.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'README.md') 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> example = decoder.decode(bytes); + List example = decoder.decode(ByteBuffer.wrap(bytes)); [ByteBuffer]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/nio/ByteBuffer.html -- cgit v1.2.3