Remove TODO file
[remote/remote-gui.git] / src / motecontrol / protocols / MsgIO.java
blobc851ce7135082fcbf29ac5b04399d08f2ffbbdc7
1 /*
2 * Created on Sep 28, 2005
4 * TODO To change the template for this generated file go to
5 * Window - Preferences - Java - Code Style - Code Templates
6 */
7 package diku.distlab.motecontrolclientlib.protocols;
9 import java.io.ByteArrayInputStream;
10 import java.io.ByteArrayOutputStream;
11 import java.io.DataInput;
12 import java.io.DataOutput;
13 import java.io.DataInputStream;
14 import java.io.DataOutputStream;
15 /**
16 * @author zept
18 * TODO To change the template for this generated type comment go to
19 * Window - Preferences - Java - Code Style - Code Templates
21 abstract public class MsgIO {
22 public byte[] getBytes() throws Exception
24 ByteArrayOutputStream bos = new ByteArrayOutputStream();
25 DataOutputStream os = new DataOutputStream(bos);
26 write(os);
27 return bos.toByteArray();
30 public void setBytes(byte[] bytes) throws Exception
32 ByteArrayInputStream bis = new ByteArrayInputStream(bytes);
33 DataInputStream is = new DataInputStream(bis);
34 read(is);
37 abstract public void read(DataInput is) throws Exception;
39 abstract public void write(DataOutput os) throws Exception;