win1for wrote: I was searching the stream methods if it is possible to send an object over the stream, but i couldn't find any of the stream methods for sending objects.
As far as I know, there is no serialization support in lejos for objects.
(The Serializable interface exists but it was used to satisfy jikes which is a java compiler).
Unless there is no reflect library you cannot program a generic serialization solution which works for all classes.
I solved the issue of serialization by using json. It's lightweight and based on strings.
I adapted a json library which can read and write json strings for lejos without the need of java reflect.
So you have only to implement the "fromJSonString" and the "toJSonString" methods for a class you want to make serializable.
"toJSonString" can use a class called "jsonstringer" which is a simple builder for json strings. You pass it the attributes you want to put in the json string (i.e. which are serialized by that) and give each a unique name under which they can be found when you deserialize your message again.
If you are interested in this solution, let me know.