public class ArduinoCodec extends Object implements ProtocolEncoder, ProtocolDecoder
| Constructor and Description |
|---|
ArduinoCodec() |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(IoSession session,
IoBuffer data,
ProtocolDecoderOutput output)
Decodes binary or protocol-specific content into higher-level message objects.
|
void |
dispose(IoSession session)
Releases all resources related with this encoder.
|
void |
encode(IoSession session,
Object message,
ProtocolEncoderOutput output)
Encodes higher-level message objects into binary or protocol-specific data.
|
void |
finishDecode(IoSession session,
ProtocolDecoderOutput output)
Invoked when the specified session is closed.
|
public void decode(IoSession session, IoBuffer data, ProtocolDecoderOutput output) throws Exception
ProtocolDecoderProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method with read data, and then the decoder implementation puts decoded
messages into ProtocolDecoderOutput.decode in interface ProtocolDecoderException - if the read data violated protocol specificationpublic void finishDecode(IoSession session, ProtocolDecoderOutput output) throws Exception
ProtocolDecoderProtocolDecoder.decode(IoSession, IoBuffer, ProtocolDecoderOutput)
method didn't process completely.finishDecode in interface ProtocolDecoderException - if the read data violated protocol specificationpublic void dispose(IoSession session) throws Exception
ProtocolEncoderdispose in interface ProtocolDecoderdispose in interface ProtocolEncoderException - if failed to dispose all resourcespublic void encode(IoSession session, Object message, ProtocolEncoderOutput output) throws Exception
ProtocolEncoderProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)
method with message which is popped from the session write queue, and then
the encoder implementation puts encoded messages (typically IoBuffers)
into ProtocolEncoderOutput.encode in interface ProtocolEncoderException - if the message violated protocol specification