Decoder#init(javax.websocket.EndpointConfig) and Decoder#destroy()
methods.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Decoder.Binary<T>
This interface defines how a custom object (of type T) is decoded from a web socket message in the form of a byte buffer. |
| public static interface | Decoder.BinaryStream<T>
This interface defines how a custom object is decoded from a web socket message in the form of a binary stream. |
| public static interface | Decoder.Text<T>
This interface defines how a custom object is decoded from a web socket message in the form of a string. |
| public static interface | Decoder.TextStream<T>
This interface defines how a custom object of type T is decoded from a web socket message in the form of a character stream. |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
This method is called when the decoder is about to be removed from service in order that any resources the encoder used may be closed gracefully. |
| public void | init(EndpointConfig
the endpoint configuration object when being brought into
service config)This method is called with the endpoint configuration object of the endpoint this decoder is intended for when it is about to be brought into service. |
| destroy | back to summary |
|---|---|
| public void destroy() This method is called when the decoder is about to be removed from service in order that any resources the encoder used may be closed gracefully. | |
| init | back to summary |
|---|---|
| public void init(EndpointConfig config) This method is called with the endpoint configuration object of the endpoint this decoder is intended for when it is about to be brought into service.
| |
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: the decoded object.the bytes to be decoded. bytes)Decode the given bytes into an object of type T. |
| public boolean | Returns: whether or not the bytes can be decoded by this decoder.the bytes to be decoded. bytes)Answer whether the given bytes can be decoded into an object of type T. |
| decode | back to summary |
|---|---|
| public T decode(ByteBuffer bytes) throws DecodeException Decode the given bytes into an object of type T.
| |
| willDecode | back to summary |
|---|---|
| public boolean willDecode(ByteBuffer bytes) Answer whether the given bytes can be decoded into an object of type T.
| |
| Modifier and Type | Method and Description |
|---|---|
| public T | Returns: the decoded object.the input stream carrying the bytes. is)Decode the given bytes read from the input stream into an object of type T. |
| decode | back to summary |
|---|---|
| public T decode(InputStream is) throws DecodeException, IOException Decode the given bytes read from the input stream into an object of type T.
| |
| Modifier and Type | Method and Description |
|---|---|
| public T | |
| public boolean | Returns: whether this decoder can decoded the supplied string.the string being tested for decodability. s)Answer whether the given String can be decoded into an object of type T. |
| decode | back to summary |
|---|---|
| public T decode(String s) throws DecodeException Decode the given String into an object of type T.
| |
| willDecode | back to summary |
|---|---|
| public boolean willDecode(String s) Answer whether the given String can be decoded into an object of type T.
| |
| Modifier and Type | Method and Description |
|---|---|
| public T |
| decode | back to summary |
|---|---|
| public T decode(Reader reader) throws DecodeException, IOException Reads the websocket message from the implementation provided Reader and decodes it into an instance of the supplied object type.
| |