How do I use a @serializable scala object?

Viewed 15265

I know that you can mark a scala object as @serializable, but I don't understand what to do with the object afterwards. Do I simply treat it as a Java Serializable object?

I want to serialize the object into a stream of bytes. Can someone show me the code to transform a serialize object into either a byte array or a string?

(the googles have not been helpful with this question)

FOLLOWUP: Thanks. I now understand that I can use it like a Java Serializable object. Sometimes the obvious answer escapes me.

2 Answers
Related