All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.bcos.channel.dto.EthereumMessage Maven / Gradle / Ivy

There is a newer version: 2.6.6
Show newest version
package org.bcos.channel.dto;

import org.bcos.channel.handler.Message;
import io.netty.buffer.ByteBuf;

public class EthereumMessage extends Message {
	private static final long serialVersionUID = 3763237749437810546L;
	
	public EthereumMessage() {
		
	}
	
	public EthereumMessage(Message msg) {
		length = msg.getLength();
		type = msg.getType();
		seq = msg.getSeq();
		result = msg.getResult();
	}

	@Override
	public void readExtra(ByteBuf in) {
		data = new byte[length - Message.HEADER_LENGTH];
		in.readBytes(data, 0, length - Message.HEADER_LENGTH);
	}
	
	@Override
	public void writeExtra(ByteBuf out) {
		out.writeBytes(data);
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy