I am programming towards the Bloomberg Desktop Java API where I subscribe to and recieve market data in Message
objects, containing different fields and corresponding values of different types, through the API. I want to 'record' a sequence of messages so that I can conduct testing of my code that processes these objects by replaying a known sequence of messages. Ideally, I would like to subscribe to a number of messages during a day and put them into an ArrayList
(or similar) and then serialize the list of objects. However, the Message
object does NOT implement the Serializable
interface so this does not appear to work the way I want it to.
Is it possible, or is there any workaround, to serialize external objects that do not implement Serializable
. Thanks.
The simplest way that I know of is xStream. Here is a FAQ from the xStream website specifically about this