public static int encode(byte[] destination,int offset,RequestedEvent requestedEvent) { int totalLength=EventNameHandler.encode(destination,offset,requestedEvent.getEventName()); if(requestedEvent.getRequestedActions()!=null) { destination[offset+totalLength]=StringFunctions.OPEN_BRACKET_BYTE; totalLength++; totalLength+=RequestedActionHandler.encodeList(destination,offset+totalLength,requestedEvent.getRequestedActions()); destination[offset+totalLength]=StringFunctions.CLOSE_BRACKET_BYTE; totalLength++; } totalLength+=EventNameHandler.encodeParams(destination,offset+totalLength,requestedEvent.getEventName()); return totalLength; }
public static int encode(byte[] destination,int offset,RequestedEvent requestedEvent) { int totalLength=EventNameHandler.encode(destination,offset,requestedEvent.getEventName()); if(requestedEvent.getRequestedActions()!=null) { destination[offset+totalLength]=StringFunctions.OPEN_BRACKET_BYTE; totalLength++; totalLength+=RequestedActionHandler.encodeList(destination,offset+totalLength,requestedEvent.getRequestedActions()); destination[offset+totalLength]=StringFunctions.CLOSE_BRACKET_BYTE; totalLength++; } totalLength+=EventNameHandler.encodeParams(destination,offset+totalLength,requestedEvent.getEventName()); return totalLength; }
public String encodeRequestedEvent(RequestedEvent evt) { StringBuffer s = new StringBuffer((evt.getEventName().getPackageName()).toString()).append("/").append( evt.getEventName().getEventIdentifier().getName()); if (evt.getEventName().getConnectionIdentifier() != null) { s.append(AMPERSAND).append(evt.getEventName().getConnectionIdentifier().toString()); } String parms = evt.getEventName().getEventIdentifier().getParms(); RequestedAction[] actions = evt.getRequestedActions(); if (actions != null) { String ac = encodeRequestedActions(actions); s.append(" (").append(ac).append(")"); } if (parms != null) { s.append(" (").append(parms).append(")"); } return s.toString(); }