EJValue value = JSONStreamDecoder.decode(request.getInputStream());
if (value.isObject() != null) {
return Collections.singletonList(from(getParts(value), session, request));
}
else if (value.isArray() != null) {
EJArray arr = value.isArray();
List<Message> messages = new ArrayList<Message>(arr.size());
for (int i = 0; i < arr.size(); i++) {
messages.add(from(getParts(arr.get(i)), session, request));
}
return messages;
}
else if (value.isNull()) {
return Collections.<Message>emptyList();