public class ByteMessageCodec extends Object implements MessageCodec<Byte,Byte>
Constructor and Description |
---|
ByteMessageCodec() |
Modifier and Type | Method and Description |
---|---|
Byte |
decodeFromWire(int pos,
Buffer buffer)
Called by Vert.x when a message is decoded from the wire.
|
void |
encodeToWire(Buffer buffer,
Byte b)
Called by Vert.x when marshalling a message to the wire.
|
String |
name()
The codec name.
|
byte |
systemCodecID()
Used to identify system codecs.
|
Byte |
transform(Byte b)
If a message is sent locally across the event bus, this method is called to transform the message from
the sent type S to the received type R
|
public void encodeToWire(Buffer buffer, Byte b)
MessageCodec
encodeToWire
in interface MessageCodec<Byte,Byte>
buffer
- the message should be written into this bufferb
- the message that is being sentpublic Byte decodeFromWire(int pos, Buffer buffer)
MessageCodec
decodeFromWire
in interface MessageCodec<Byte,Byte>
pos
- the position in the buffer where the message should be read from.buffer
- the buffer to read the message frompublic Byte transform(Byte b)
MessageCodec
transform
in interface MessageCodec<Byte,Byte>
b
- the sent messagepublic String name()
MessageCodec
name
in interface MessageCodec<Byte,Byte>
public byte systemCodecID()
MessageCodec
systemCodecID
in interface MessageCodec<Byte,Byte>
Copyright © 2015. All Rights Reserved.