Enum Class DecodeStatus
- All Implemented Interfaces:
Serializable, Comparable<DecodeStatus>, Constable
The outcome of a decode, per the finish-less three-valued model of
CORELIB_PLAN §5.2.1 / MESSAGE_SPEC §7. It is identical for one-shot and
streaming decodes, it describes the bytes consumed so far, and there is
no finish/finalize step: "the status
feed returns is the
answer" (§5.2.4), and the caller owns end-of-input.
COMPLETE— the consumed bytes end exactly at a field boundary (a valid message).INCOMPLETE— the consumed bytes end inside a field (a partial varint, a fixlen/array payload shorter than declared) or with an open, unclosed sequence. This is not an error: more bytes could complete the message, and the caller decides whether a trailingINCOMPLETEis a truncation it cares about.INVALID— the bytes are malformed regardless of what follows (varint over 64 bits, bad type/subtype tag, length/count/id over max, dangling sequence-end, nesting pastMAX_DEPTH, invalid UTF-8). It names the third outcome; it is not a valueIStream.feed(byte[], Visitor)returns, because this library carries a refusal on the error channel — see below.
Which of the three feed returns. IStream.feed(byte[], Visitor) returns
COMPLETE or INCOMPLETE — the two outcomes more bytes can still
change. INVALID arrives instead as a thrown SofabException
carrying SofabError.INVALID_MSG, the code §6.3 pairs with this outcome
("INVALID corresponds to InvalidMessage"), and the same
exception channel carries SofabError.LIMIT_EXCEEDED, the receiver-cap
refusal of well-formed bytes that §6.3 keeps distinct from it. §6.0 names the
three outcomes; it does not prescribe the carrier, and refusals leave by the
one route a Java caller cannot ignore. Both are terminal: the decoder latches
them and every further feed re-throws until IStream.reset().
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionThe consumed bytes end exactly at a field boundary — a valid message.The consumed bytes end inside a field or with an open sequence; more bytes could complete the message.The bytes are malformed regardless of what follows — the third outcome of §5.2.1, and the oneIStream.feed(byte[], Visitor)does not return: it throws aSofabExceptionwithSofabError.INVALID_MSGinstead, then latches the verdict so no continuation can revise it and every furtherfeedthrows again untilIStream.reset(). -
Method Summary
Modifier and TypeMethodDescriptionstatic DecodeStatusReturns the enum constant of this class with the specified name.static DecodeStatus[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
COMPLETE
The consumed bytes end exactly at a field boundary — a valid message. -
INCOMPLETE
The consumed bytes end inside a field or with an open sequence; more bytes could complete the message. Not an error. -
INVALID
The bytes are malformed regardless of what follows — the third outcome of §5.2.1, and the oneIStream.feed(byte[], Visitor)does not return: it throws aSofabExceptionwithSofabError.INVALID_MSGinstead, then latches the verdict so no continuation can revise it and every furtherfeedthrows again untilIStream.reset().
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-