package com.imdroid.sideslope.message;

import io.netty.buffer.ByteBuf;

/**
 * @author Layton
 * @date 2023/2/2 20:47
 */
public class D314PingMessage extends BaseMessage {

    @Override
    public void decodeBody(ByteBuf src) {
        //srcData需要完整的消息，所以解析头用get方法
        this.header = src.getUnsignedShort(0); // flag
        this.len = src.getUnsignedShort(2); // length:11bit
        this.seq = 0;
        this.id = String.valueOf(src.getUnsignedInt(4)); //id

        this.srcData = new byte[src.readableBytes()];
        src.readBytes(this.srcData);
    }

    @Override
    public boolean shouldDecodeHeader() {
        return false;
    }
}
