This ugly workaround has been introduced when standard Option
encoding changed from zero-or-one element list
encoding to unwrapped-or-null encoding which effectively disallowed serializing null
and Some(null)
.
This ugly workaround has been introduced when standard Option
encoding changed from zero-or-one element list
encoding to unwrapped-or-null encoding which effectively disallowed serializing null
and Some(null)
.
If some Input
implementation still wants to use the list encoding, it may do it by overriding this method
and returning true
.
Represents an abstract source from which a value may be deserialized (read). Each of the
read
methods tries to read a value of specified type and may throw an exception (usually ReadFailure) when reading is not successful.An Input value should be assumed to be stateful. If any of the
readX
methods have already been called, the Input instance can no longer be used and MUST be discarded.In order to ignore the value kept in this Input,
skip()
MUST be called.In summary: every Input MUST be fully exhausted by either calling one of the
read
methods which returns successful value or by callingskip()
. Also, ListInput and ObjectInput instances returned from this Input must also be fully exhausted on their own.