Class Codec.Result
- Direct Known Subclasses:
Decoder.Result
,HttpEncoder.Result
,WsEncoder.Result
- Enclosing interface:
- Codec
Derived classes add their respective additional values.
The class is declared abstract to promote the usage of the factory method.
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
A base class for a factory that creates results. -
Constructor Summary
ModifierConstructorDescriptionprotected
Result
(boolean overflow, boolean underflow, boolean closeConnection) Creates a new result with the given values. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Indicates that the connection to the receiver of the response must be closed after sending any remaining data in the out buffer.boolean
int
hashCode()
boolean
Indicates that the data didn’t fit in the out buffer.boolean
Indicates that more data is needed to complete the encoding or decoding of the entity.toString()
-
Constructor Details
-
Result
Creates a new result with the given values.- Parameters:
overflow
- true if the data didn’t fit in the out bufferunderflow
- true if more data is expectedcloseConnection
- true if the connection should be closed
-
-
Method Details
-
isOverflow
Indicates that the data didn’t fit in the out buffer.The encoding method that has returned this result should be re-invoked with the same parameters except for a new (or cleared) output buffer.
- Returns:
- true if overflow occurred
- See Also:
-
isUnderflow
Indicates that more data is needed to complete the encoding or decoding of the entity.Codecs may report an underflow condition even if there is still data available in the input buffer in order to report some special condition in an extended result type. In this case, the encode or decode method should be reinvoked with the same parameters after handling the special condition that has been reported.
If underflow is reported and the input buffer is empty, the encode or decode method should be reinvoked with the same parameters except for an input buffer with additional information.
A result with both overflow and underflow set to false indicates the completion of the encoding or decoding process of the entity. In this case, the input buffer may still contain data that belongs to the next entity that is to be encoded or decoded.
- Returns:
- true if underflow occurred
-
closeConnection
Indicates that the connection to the receiver of the response must be closed after sending any remaining data in the out buffer.- Returns:
- the value
-
hashCode
-
equals
-
toString
-