package net.northking.cctp.upperComputer.driver.ios.command.data;


import net.northking.cctp.upperComputer.driver.ios.packet.CodecUtils;
import net.northking.cctp.upperComputer.driver.ios.packet.ICommandData;

import java.io.DataInput;
import java.io.DataOutput;
import java.io.IOException;

public class TextData implements ICommandData {

    public String text;


    public void setText(String text) {
        this.text = text;
    }

    public String getText() {
        return text;
    }
    @Override
    public void buildFromInput(DataInput dataInput) throws IOException {
        text = CodecUtils.readText(dataInput);
    }

    @Override
    public void encodeToOutput(DataOutput dataOutput) throws IOException {
        CodecUtils.writeText(dataOutput, text);
    }

    @Override
    public String toString() {
        return "TextData{" +
                "text=" + text +

                '}';
    }
}
