aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/eu
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-12-18 18:57:37 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2021-12-18 18:57:37 +0100
commit3f13b66f763fc6ecbedbb32971ba7807397a32f6 (patch)
tree0ab26dfe2e102afb1f87c5bdc15dfe42335cb543 /src/main/java/eu
parentfe45858847c31226af28e6d06dc0e250d895e7c6 (diff)
Slightly improved Javadocs.
Change-Id: I9e572833ff368c98002cb7f81052a65af0f68ca2
Diffstat (limited to 'src/main/java/eu')
-rw-r--r--src/main/java/eu/mulk/jgvariant/core/Decoder.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/eu/mulk/jgvariant/core/Decoder.java b/src/main/java/eu/mulk/jgvariant/core/Decoder.java
index d30366e..461b9fa 100644
--- a/src/main/java/eu/mulk/jgvariant/core/Decoder.java
+++ b/src/main/java/eu/mulk/jgvariant/core/Decoder.java
@@ -52,6 +52,13 @@ public abstract class Decoder<T> {
/**
* Decodes a {@link ByteBuffer} holding a serialized GVariant into a value of type {@code T}.
*
+ * <p><strong>Note:</strong> Due to the way the GVariant serialization format works, it is
+ * important that the start and end boundaries of the passed byte slice correspond to the actual
+ * start and end of the serialized value. The format does generally not allow for the dynamic
+ * discovery of the end of the data structure.
+ *
+ * @param byteSlice a byte slice holding a serialized GVariant.
+ * @return the deserialized value.
* @throws java.nio.BufferUnderflowException if the byte buffer is shorter than the requested
* data.
* @throws IllegalArgumentException if the serialized GVariant is ill-formed
@@ -239,6 +246,7 @@ public abstract class Decoder<T> {
* <p><strong>Note:</strong> While GVariant does not prescribe any particular encoding, {@link
* java.nio.charset.StandardCharsets#UTF_8} is the most common choice.
*
+ * @param charset the {@link Charset} the string is encoded in.
* @return a new {@link Decoder}.
*/
public static Decoder<String> ofString(Charset charset) {