Package dev.getelements.elements.rt
Interface PayloadWriter
- All Known Implementing Classes:
FSTPayloadWriter
,KryoPayloadWriter
,ObjectMapperPayloadWriter
public interface PayloadWriter
Handles the actual details of writing an
Object
to a byte stream.-
Method Summary
Modifier and TypeMethodDescriptiondefault byte[]
Writes the suppliedObject
payload to a byte array.void
write
(Object payload, OutputStream stream) Writes the actual response object to theOutputStream
.
-
Method Details
-
write
Writes the actual response object to theOutputStream
.- Parameters:
payload
- the the response objectstream
- the output stream- Throws:
IOException
-
write
Writes the suppliedObject
payload to a byte array. The default implementation uses a temporaryByteArrayOutputStream
to accomplish this task.- Parameters:
payload
- theObject
payload- Returns:
- the byte stream representing the
Object
- Throws:
IOException
-