[quote]The problem is i have 6 different values to send. They are all primative data type accept the 2 AffineTransforms so thought it would be quicker to send them in a String, then send an object.
Ill try send the values that the AffineTransforms are made up of, and construct them from the values at the other end.
If anyone gets a better idea, let me know. Thanks.
[/quote]
Fortunately the ObjectOutputStream can write primitive data types too. (with writeByte,writeFloat etc…)
Example:
//Writing
ByteArrayOutputStream baos=new ByteArrayOutputStream();
ObjectOutputStream oos=new ObjectOutputStream(baos);
oos.writeFloat(0.4f);
oos.writeObject("Hello");
byte[] b=baos.toByteArray(); // Here you have the byte array with the data, send it anywhere
//...
//Reading from a byte array "b"
ObjectInputStream ois=new ObjectInputStream(new ByteArrayInputStream(b));
float f=ois.readFloat();
String s=(String)ois.readObject();
Although if somebody has a better solution, I would like to see.