Skip to content

Commit d63baef

Browse files
author
Roman Janusz
committed
clarified scaladoc of CborObjectInput
1 parent 942a576 commit d63baef

File tree

1 file changed

+5
-3
lines changed
  • commons-core/src/main/scala/com/avsystem/commons/serialization/cbor

1 file changed

+5
-3
lines changed

commons-core/src/main/scala/com/avsystem/commons/serialization/cbor/CborInput.scala

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class CborObjectInput(reader: CborReader, size: Int, keyCodec: CborKeyCodec)
434434
extends CborSequentialInput(reader, size) with ObjectInput {
435435

436436
private[this] var forcedKeyCodec: CborKeyCodec = _
437-
private[this] def currentKeyCodec = if(forcedKeyCodec != null) forcedKeyCodec else keyCodec
437+
private[this] def currentKeyCodec = if (forcedKeyCodec != null) forcedKeyCodec else keyCodec
438438

439439
/**
440440
* Returns a [[CborOutput]] for reading a raw CBOR field key. This is an extension over standard
@@ -448,8 +448,10 @@ class CborObjectInput(reader: CborReader, size: Int, keyCodec: CborKeyCodec)
448448

449449
/**
450450
* Returns a [[CborOutput]] for reading the value of a CBOR field whose key was previously read with [[nextKey()]].
451-
* This method MUST ONLY be used after the key was fully read using [[nextKey()]]. If this method is used to
452-
* read the field value then [[nextField()]] MUST NOT be used.
451+
* This method MUST ONLY be used after the key was fully read using [[nextKey()]]. Fully reading the input means
452+
* that all its bytes must be consumed. For example, if the key is an array or object then all its elements/fields
453+
* must be consumed.
454+
* If this method is used to read the field value then [[nextField()]] MUST NOT be used.
453455
*/
454456
def nextValue(): CborInput =
455457
new CborInput(reader, keyCodec)

0 commit comments

Comments
 (0)