in broker-plugins/amqp-0-10-protocol/src/main/java/org/apache/qpid/server/protocol/v0_10/transport/AbstractDecoder.java [386:476]
private Object read(Type t)
{
switch (t)
{
case BIN8:
case UINT8:
return readUint8();
case INT8:
return get();
case CHAR:
return (char) get();
case BOOLEAN:
return get() > 0;
case BIN16:
case UINT16:
return readUint16();
case INT16:
return (short) readUint16();
case BIN32:
case UINT32:
return readUint32();
case CHAR_UTF32:
case INT32:
return (int) readUint32();
case FLOAT:
return Float.intBitsToFloat((int) readUint32());
case BIN64:
case UINT64:
case INT64:
case DATETIME:
return readUint64();
case DOUBLE:
return Double.longBitsToDouble(readUint64());
case UUID:
return readUuid();
case STR8:
return readStr8();
case STR16:
return readStr16();
case STR8_LATIN:
case STR16_LATIN:
Charset charset;
try
{
charset = Charset.forName("ISO-8859-15");
}
catch (UnsupportedCharsetException e)
{
// We do not want to start throwing execptions from here so we fall back to ISO_8859_1
charset = StandardCharsets.ISO_8859_1;
}
return new String(readBytes(t), charset);
case STR8_UTF16:
case STR16_UTF16:
return new String(readBytes(t), StandardCharsets.UTF_16);
case MAP:
return readMap();
case LIST:
return readList();
case ARRAY:
return readArray();
case STRUCT32:
return readStruct32();
case BIN40:
case DEC32:
case BIN72:
case DEC64:
// XXX: what types are we supposed to use here?
return readBytes(t);
case VOID:
return null;
default:
return readBytes(t);
}
}