public class BasePayload extends Object implements ExtendedPayload
| Constructor and Description |
|---|
BasePayload() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
PayloadMetadata |
getMetadata()
Returns a valid PayloadMetadata for this payload, or
null if no metadata is provided. |
InputStream |
readFrom()
Returns a valid InputStream for this payload, or
null if not supported. |
void |
writeTo(OutputStream out)
Writes the payload data to the given OutputStream.
|
public InputStream readFrom() throws IOException
Payloadnull if not supported. If this method returns a valid
InputStream, Payload.writeTo(java.io.OutputStream) will never be called.readFrom in interface PayloadIOExceptionpublic void writeTo(OutputStream out) throws IOException
PayloadPayload.readFrom() returns null, this method must
be implemented.writeTo in interface Payloadout - non-null output stream to which to write the payload dataIOExceptionpublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic PayloadMetadata getMetadata()
ExtendedPayloadnull if no metadata is provided.getMetadata in interface ExtendedPayload