Encoder#init(javax.websocket.EndpointConfig) and Encoder#destroy()
methods.
| Modifier and Type | Class and Description |
|---|---|
| public static interface | Encoder.Binary<
The type of the custom object that this Encoder can encoder to a ByteBuffer. T>This interface defines how to provide a way to convert a custom object into a binary message. |
| public static interface | Encoder.BinaryStream<
the type of the object this encoder can encode. T>This interface may be implemented by encoding algorithms that want to write the encoded object to a binary stream. |
| public static interface | Encoder.Text<
The type of the custom developer object that this Encoder can encode into a String. T>This interface defines how to provide a way to convert a custom object into a text message. |
| public static interface | Encoder.TextStream<
the type of the object this encoder can encode to a CharacterStream. T>This interface may be implemented by encoding algorithms that want to write the encoded object to a character stream. |
| Modifier and Type | Method and Description |
|---|---|
| public void | destroy()
This method is called when the encoder 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 encoder 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 encoder 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 encoder is intended for when it is about to be brought into service.
| |
| Modifier and Type | Method and Description |
|---|---|
| public ByteBuffer | Returns: the binary data.the object being encoded. object)Encode the given object into a byte array. |
| encode | back to summary |
|---|---|
| public ByteBuffer encode(T object) throws EncodeException Encode the given object into a byte array.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void | encode(T
the object being encoded. object, OutputStream the output stream where the encoded data is written. os)Encode the given object into a binary stream written to the implementation provided OutputStream. |
| encode | back to summary |
|---|---|
| public void encode(T object, OutputStream os) throws EncodeException, IOException Encode the given object into a binary stream written to the implementation provided OutputStream.
| |
| Modifier and Type | Method and Description |
|---|---|
| public String | Returns: the encoded object as a string.the object being encoded. object)Encode the given object into a String. |
| encode | back to summary |
|---|---|
| public String encode(T object) throws EncodeException Encode the given object into a String.
| |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| encode | back to summary |
|---|---|
| public void encode(T object, Writer writer) throws EncodeException, IOException Encode the given object to a character stream writing it to the supplied Writer. Implementations of this method may use the EncodeException to indicate a failure to convert the supplied object to an encoded form, and may use the IOException to indicate a failure to write the data to the supplied stream.
| |