package at.acdp.urweb.rtde.packets;

import at.acdp.urweb.rtde.RTDEClient;
import org.slf4j.LoggerFactory;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;

public interface IRtdeData<T> {
    final static org.slf4j.Logger logger = LoggerFactory.getLogger(RTDEClient.class);

    int getType();

    int getSize();

    void setReplySize(int i);


    T read(DataInputStream di) throws IOException;

    T send(DataOutputStream dos) throws IOException;

    default void sendHeader(DataOutputStream dos) throws IOException {
        dos.writeShort(getSize());
        dos.writeByte(getType());
    }

}
