public interface Payload extends Closeable
readFrom() and seeing if the result is
non-null. If so, that stream is read and closed. If the result is null, then the writeTo(java.io.OutputStream)
method will be called with an OutputStream which can be filled with the payload data.| Modifier and Type | Method and Description |
|---|---|
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.
|
InputStream readFrom() throws IOException
null if not supported. If this method returns a valid
InputStream, writeTo(java.io.OutputStream) will never be called.IOExceptionvoid writeTo(OutputStream out) throws IOException
readFrom() returns null, this method must
be implemented.out - non-null output stream to which to write the payload dataIOException