@Test public void deserialize() { serialize(); }
public static RetryMessageModel deserialize(ByteBuf buffer) { RetryMessageModel retryMessageModel = new RetryMessageModel(); short buzIdLen = buffer.readShort(); if (buzIdLen > 0) { byte[] buzId = new byte[buzIdLen]; buffer.readBytes(buzId); String businessId = new String(buzId, Charset.forName("UTF-8")); retryMessageModel.setBusinessId(businessId); } short topicLen = buffer.readShort(); byte[] topicBytes = new byte[topicLen]; buffer.readBytes(topicBytes); String topic = new String(topicBytes, Charset.forName("UTF-8")); retryMessageModel.setTopic(topic); short appLen = buffer.readShort(); byte[] appBytes = new byte[appLen]; buffer.readBytes(appBytes); String app = new String(appBytes, Charset.forName("UTF-8")); retryMessageModel.setApp(app); short partition = buffer.readShort(); retryMessageModel.setPartition(partition); long index = buffer.readLong(); retryMessageModel.setIndex(index); int messageLen = buffer.readInt(); byte[] messageBytes = new byte[messageLen]; buffer.readBytes(messageBytes); retryMessageModel.setBrokerMessage(messageBytes); short exceptionLen = buffer.readShort(); if (exceptionLen > 0) { byte[] exceptionBytes = new byte[exceptionLen]; buffer.readBytes(exceptionBytes); retryMessageModel.setException(exceptionBytes); } long sendTime = buffer.readLong(); retryMessageModel.setSendTime(sendTime); return retryMessageModel; }
RetrySerializerUtil { public static RetryMessageModel deserialize(ByteBuf buffer) { RetryMessageModel retryMessageModel = new RetryMessageModel(); short buzIdLen = buffer.readShort(); if (buzIdLen > 0) { byte[] buzId = new byte[buzIdLen]; buffer.readBytes(buzId); String businessId = new String(buzId, Charset.forName("UTF-8")); retryMessageModel.setBusinessId(businessId); } short topicLen = buffer.readShort(); byte[] topicBytes = new byte[topicLen]; buffer.readBytes(topicBytes); String topic = new String(topicBytes, Charset.forName("UTF-8")); retryMessageModel.setTopic(topic); short appLen = buffer.readShort(); byte[] appBytes = new byte[appLen]; buffer.readBytes(appBytes); String app = new String(appBytes, Charset.forName("UTF-8")); retryMessageModel.setApp(app); short partition = buffer.readShort(); retryMessageModel.setPartition(partition); long index = buffer.readLong(); retryMessageModel.setIndex(index); int messageLen = buffer.readInt(); byte[] messageBytes = new byte[messageLen]; buffer.readBytes(messageBytes); retryMessageModel.setBrokerMessage(messageBytes); short exceptionLen = buffer.readShort(); if (exceptionLen > 0) { byte[] exceptionBytes = new byte[exceptionLen]; buffer.readBytes(exceptionBytes); retryMessageModel.setException(exceptionBytes); } long sendTime = buffer.readLong(); retryMessageModel.setSendTime(sendTime); return retryMessageModel; } }
RetrySerializerUtil { public static RetryMessageModel deserialize(ByteBuf buffer) { RetryMessageModel retryMessageModel = new RetryMessageModel(); short buzIdLen = buffer.readShort(); if (buzIdLen > 0) { byte[] buzId = new byte[buzIdLen]; buffer.readBytes(buzId); String businessId = new String(buzId, Charset.forName("UTF-8")); retryMessageModel.setBusinessId(businessId); } short topicLen = buffer.readShort(); byte[] topicBytes = new byte[topicLen]; buffer.readBytes(topicBytes); String topic = new String(topicBytes, Charset.forName("UTF-8")); retryMessageModel.setTopic(topic); short appLen = buffer.readShort(); byte[] appBytes = new byte[appLen]; buffer.readBytes(appBytes); String app = new String(appBytes, Charset.forName("UTF-8")); retryMessageModel.setApp(app); short partition = buffer.readShort(); retryMessageModel.setPartition(partition); long index = buffer.readLong(); retryMessageModel.setIndex(index); int messageLen = buffer.readInt(); byte[] messageBytes = new byte[messageLen]; buffer.readBytes(messageBytes); retryMessageModel.setBrokerMessage(messageBytes); short exceptionLen = buffer.readShort(); if (exceptionLen > 0) { byte[] exceptionBytes = new byte[exceptionLen]; buffer.readBytes(exceptionBytes); retryMessageModel.setException(exceptionBytes); } long sendTime = buffer.readLong(); retryMessageModel.setSendTime(sendTime); return retryMessageModel; }  }
RetrySerializerUtil { public static RetryMessageModel deserialize(ByteBuf buffer) { RetryMessageModel retryMessageModel = new RetryMessageModel(); short buzIdLen = buffer.readShort(); if (buzIdLen > 0) { byte[] buzId = new byte[buzIdLen]; buffer.readBytes(buzId); String businessId = new String(buzId, Charset.forName("UTF-8")); retryMessageModel.setBusinessId(businessId); } short topicLen = buffer.readShort(); byte[] topicBytes = new byte[topicLen]; buffer.readBytes(topicBytes); String topic = new String(topicBytes, Charset.forName("UTF-8")); retryMessageModel.setTopic(topic); short appLen = buffer.readShort(); byte[] appBytes = new byte[appLen]; buffer.readBytes(appBytes); String app = new String(appBytes, Charset.forName("UTF-8")); retryMessageModel.setApp(app); short partition = buffer.readShort(); retryMessageModel.setPartition(partition); long index = buffer.readLong(); retryMessageModel.setIndex(index); int messageLen = buffer.readInt(); byte[] messageBytes = new byte[messageLen]; buffer.readBytes(messageBytes); retryMessageModel.setBrokerMessage(messageBytes); short exceptionLen = buffer.readShort(); if (exceptionLen > 0) { byte[] exceptionBytes = new byte[exceptionLen]; buffer.readBytes(exceptionBytes); retryMessageModel.setException(exceptionBytes); } long sendTime = buffer.readLong(); retryMessageModel.setSendTime(sendTime); return retryMessageModel; }  static RetryMessageModel deserialize(ByteBuf buffer); static ByteBuffer serialize(RetryMessageModel retryMessageModel); }
RetrySerializerUtil { public static RetryMessageModel deserialize(ByteBuf buffer) { RetryMessageModel retryMessageModel = new RetryMessageModel(); short buzIdLen = buffer.readShort(); if (buzIdLen > 0) { byte[] buzId = new byte[buzIdLen]; buffer.readBytes(buzId); String businessId = new String(buzId, Charset.forName("UTF-8")); retryMessageModel.setBusinessId(businessId); } short topicLen = buffer.readShort(); byte[] topicBytes = new byte[topicLen]; buffer.readBytes(topicBytes); String topic = new String(topicBytes, Charset.forName("UTF-8")); retryMessageModel.setTopic(topic); short appLen = buffer.readShort(); byte[] appBytes = new byte[appLen]; buffer.readBytes(appBytes); String app = new String(appBytes, Charset.forName("UTF-8")); retryMessageModel.setApp(app); short partition = buffer.readShort(); retryMessageModel.setPartition(partition); long index = buffer.readLong(); retryMessageModel.setIndex(index); int messageLen = buffer.readInt(); byte[] messageBytes = new byte[messageLen]; buffer.readBytes(messageBytes); retryMessageModel.setBrokerMessage(messageBytes); short exceptionLen = buffer.readShort(); if (exceptionLen > 0) { byte[] exceptionBytes = new byte[exceptionLen]; buffer.readBytes(exceptionBytes); retryMessageModel.setException(exceptionBytes); } long sendTime = buffer.readLong(); retryMessageModel.setSendTime(sendTime); return retryMessageModel; }  static RetryMessageModel deserialize(ByteBuf buffer); static ByteBuffer serialize(RetryMessageModel retryMessageModel);  }