I have some workflows in my application where I am requesting data and it gets serialized and deserialized several times on the way back to the user interface. The number of services that the data passes through is necessary, and I am unlikely to be able to change the architecture of the workflows. Is there any data format that I can use as a pass-through so that the data is not repeatedly serialized/deserialized as it progresses through the workflow? For example, if I convert it to a byte array after the data is retrieved by the data layer, or assembled via some other process, can I instruct Spring to leave it as-is and not incur the penalty of repeated marshaling and unmarshaling?
As @jb-nizet said, simply return or accept byte arrays to avoid serialization and deserialization.