In the specification Java API for WebSocket 1.0, also known as JSR-356, it says on page 16:

On Decoder implementations that have it, the implementation must use the willDecode() method on the decoder to determine if the Decoder will match the incoming message.

.. and on page 17:

If the Decoder implementation has the method, the implementation must use the willDecode() method on the decoder to determine if the Decoder will match the incoming message

Clearly then, it is optional for me as a developer to provide that method or not. However, if you look at the Java EE 7 API, the interface Decoder.Binary and Decoder.Text declares this method. Thus when I write a decoder class that implements one of these interfaces, then I must also provide an implementation for willDecode(). The way I see it, there's no free choice any more. Am I wrong?

有帮助吗?

解决方案

Yes. These are optional. Encode and Decode use for security purpose in data transmission.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top