public final class TypedMessage extends Object
Copyright (c) 2016-2017 Delft University of Technology, PO Box 5, 2600 AA, Delft, the Netherlands. All rights reserved.
BSD-style license. See OpenTrafficSim License.
Modifier and Type | Field and Description |
---|---|
protected static int |
BOOLEAN_ARRAY_HC
hashcode of boolean[] class.
|
protected static int |
BOOLEAN_HC
hashcode of Boolean class.
|
protected static int |
BOOLEAN_MATRIX_HC
hashcode of boolean[][] class.
|
protected static int |
BYTE_ARRAY_HC
hashcode of byte[] class.
|
protected static int |
BYTE_HC
hashcode of Byte class.
|
protected static int |
BYTE_MATRIX_HC
hashcode of byte[][] class.
|
protected static int |
CHAR_HC
hashcode of Character class.
|
protected static int |
DOUBLE_ARRAY_HC
hashcode of double[] class.
|
protected static int |
DOUBLE_HC
hashcode of Double class.
|
protected static int |
DOUBLE_MATRIX_HC
hashcode of double[][] class.
|
protected static int |
FLOAT_ARRAY_HC
hashcode of float[] class.
|
protected static int |
FLOAT_HC
hashcode of Float class.
|
protected static int |
FLOAT_MATRIX_HC
hashcode of float[][] class.
|
protected static int |
INT_ARRAY_HC
hashcode of int[] class.
|
protected static int |
INT_MATRIX_HC
hashcode of int[][] class.
|
protected static int |
INTEGER_HC
hashcode of Integer class.
|
protected static int |
LONG_ARRAY_HC
hashcode of long[] class.
|
protected static int |
LONG_HC
hashcode of Long class.
|
protected static int |
LONG_MATRIX_HC
hashcode of long[][] class.
|
protected static int |
SHORT_ARRAY_HC
hashcode of short[] class.
|
protected static int |
SHORT_HC
hashcode of Short class.
|
protected static int |
SHORT_MATRIX_HC
hashcode of short[][] class.
|
protected static int |
STRING_HC
hashcode of String class.
|
protected static Charset |
UTF16
the UTF-16 charset, big endian variant.
|
protected static Charset |
UTF8
the UTF-8 charset.
|
protected static String |
VERSION
version of the protocol, magic number.
|
Modifier and Type | Method and Description |
---|---|
static Object[] |
decode(byte[] message)
Decode the message into an object array.
|
static Object[] |
decodeSim0MQMessage(byte[] message)
Decode the message into an object array.
|
static byte[] |
encode0MQMessageUTF16(Object... content)
Encode the object array into a byte[] message.
|
static byte[] |
encode0MQMessageUTF8(Object... content)
Encode the object array into a byte[] message.
|
static byte[] |
encodeUTF16(Object... content)
Encode the object array into a byte[] message.
|
static byte[] |
encodeUTF8(Object... content)
Encode the object array into a byte[] message.
|
static String |
printBytes(byte[] bytes)
Return a readable string with the bytes in a byte[] message.
|
protected static final String VERSION
protected static final int BYTE_HC
protected static final int SHORT_HC
protected static final int INTEGER_HC
protected static final int LONG_HC
protected static final int FLOAT_HC
protected static final int DOUBLE_HC
protected static final int BOOLEAN_HC
protected static final int CHAR_HC
protected static final int STRING_HC
protected static final int BYTE_ARRAY_HC
protected static final int SHORT_ARRAY_HC
protected static final int INT_ARRAY_HC
protected static final int LONG_ARRAY_HC
protected static final int FLOAT_ARRAY_HC
protected static final int DOUBLE_ARRAY_HC
protected static final int BOOLEAN_ARRAY_HC
protected static final int BYTE_MATRIX_HC
protected static final int SHORT_MATRIX_HC
protected static final int INT_MATRIX_HC
protected static final int LONG_MATRIX_HC
protected static final int FLOAT_MATRIX_HC
protected static final int DOUBLE_MATRIX_HC
protected static final int BOOLEAN_MATRIX_HC
protected static final Charset UTF8
protected static final Charset UTF16
public static byte[] encodeUTF8(Object... content) throws Sim0MQException
content
- the objects to encodeSim0MQException
- on unknown data typepublic static byte[] encodeUTF16(Object... content) throws Sim0MQException
content
- the objects to encodeSim0MQException
- on unknown data typepublic static byte[] encode0MQMessageUTF8(Object... content) throws Sim0MQException
content
- the objects to encodeSim0MQException
- on unknown data typepublic static byte[] encode0MQMessageUTF16(Object... content) throws Sim0MQException
content
- the objects to encodeSim0MQException
- on unknown data typepublic static Object[] decodeSim0MQMessage(byte[] message) throws Sim0MQException
message
- the ZeroMQ byte array to decodeSim0MQException
- on unknown data typepublic static Object[] decode(byte[] message) throws Sim0MQException
message
- the ZeroMQ byte array to decodeSim0MQException
- on unknown data typepublic static String printBytes(byte[] bytes)
bytes
- byte[]; the byte array to displayCopyright © 2016–2018 Delft University of Technology. All rights reserved.