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 suppliedObjectpayload to a byte array.voidwrite(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 suppliedObjectpayload to a byte array. The default implementation uses a temporaryByteArrayOutputStreamto accomplish this task.- Parameters:
payload- theObjectpayload- Returns:
- the byte stream representing the
Object - Throws:
IOException
-