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
Payload
null
if not supported. If this method returns a valid
InputStream, Payload.writeTo(java.io.OutputStream)
will never be called.readFrom
in interface Payload
IOException
public void writeTo(OutputStream out) throws IOException
Payload
Payload.readFrom()
returns null
, this method must
be implemented.writeTo
in interface Payload
out
- non-null
output stream to which to write the payload dataIOException
public void close() throws IOException
close
in interface Closeable
close
in interface AutoCloseable
IOException
public PayloadMetadata getMetadata()
ExtendedPayload
null
if no metadata is provided.getMetadata
in interface ExtendedPayload