1234567891011121314151617181920212223242526272829 |
- 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();
- default boolean hasReply() {
- return true;
- }
- T read(DataInputStream di, int length) throws IOException;
- T send(DataOutputStream dos) throws IOException;
- default void sendHeader(DataOutputStream dos, int length) throws IOException {
- dos.writeShort(length+3);
- dos.writeByte(getType());
- }
- }
|