}
qObj.encode(enc);
break;
case 21: // List
ArrayList<Object> items = (ArrayList<Object>) val;
BBEncoder lEnc = new BBEncoder(1);
lEnc.init();
lEnc.writeUint32(items.size());
for (Object obj : items)
{
short innerType = Util.qmfType(obj);
lEnc.writeUint8(innerType);
this.encodeValue(lEnc, innerType, obj);
}
enc.writeVbin32(lEnc.segment().array());
break;
case 22: // Array
ArrayList<Object> aItems = (ArrayList<Object>) val;
BBEncoder aEnc = new BBEncoder(1);
aEnc.init();
long aCount = aItems.size();
aEnc.writeUint32(aCount);
if (aCount > 0)
{
Object anObj = aItems.get(0);
short innerType = Util.qmfType(anObj);
aEnc.writeUint8(innerType);
for (Object obj : aItems)
{
this.encodeValue(aEnc, innerType, obj);
}
}
enc.writeVbin32(aEnc.segment().array());
break;
default:
throw new ConsoleException(String.format(
"Invalid Type Code: %s", type));
}