private void parseLogClientSync(ClientSync sync, ByteBuffer buf, int options, int payloadLength) { LogClientSync logSync = new LogClientSync(); logSync.setRequestId(getIntFromUnsignedShort(buf)); int size = getIntFromUnsignedShort(buf); List<LogEntry> logs = new ArrayList<>(size); for (int i = 0; i < size; i++) { logs.add(new LogEntry(getNewByteBuffer(buf, buf.getInt()))); } logSync.setLogEntries(logs); sync.setLogSync(logSync); }
private static LogClientSync convert(LogSyncRequest source) { if (source == null) { return null; } LogClientSync sync = new LogClientSync(); sync.setRequestId(source.getRequestId()); if (source.getLogEntries() != null) { List<LogEntry> logs = new ArrayList<LogEntry>(source.getLogEntries().size()); for (org.kaaproject.kaa.common.endpoint.gen.LogEntry log : source.getLogEntries()) { logs.add(new LogEntry(log.getData())); } sync.setLogEntries(logs); } return sync; }