int flags = i >> 24 & 0xff;
boolean isRequest = ((flags & REQUEST_FLAG) == REQUEST_FLAG);
int code = i & 0xffffff;
Dictionary dictionary = Dictionary.getInstance();
DiameterCommand command = isRequest ? dictionary.getRequest(code) : dictionary.getAnswer(code);
if (command == null)
command = isRequest ? Factory.newRequest(code, "Unknown") : Factory.newAnswer(code, "Unknown");
DiameterMessage message = isRequest ? new DiameterRequest() : new DiameterAnswer();