Package com.boomi.connector.util
Class BasePayload
- java.lang.Object
-
- com.boomi.connector.util.BasePayload
-
- All Implemented Interfaces:
ExtendedPayload
,Payload
,Closeable
,AutoCloseable
public class BasePayload extends Object implements ExtendedPayload
Convenience base class for Payload implementations. None of the base methods do anything. This class has been moved from com.boomi.connector.api to com.boomi.connector.util.
-
-
Constructor Summary
Constructors Constructor Description BasePayload()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
PayloadMetadata
getMetadata()
Returns a valid PayloadMetadata for this payload, ornull
if no metadata is provided.InputStream
readFrom()
Returns a valid InputStream for this payload, ornull
if not supported.void
writeTo(OutputStream out)
Writes the payload data to the given OutputStream.
-
-
-
Method Detail
-
readFrom
public InputStream readFrom() throws IOException
Description copied from interface:Payload
Returns a valid InputStream for this payload, ornull
if not supported. If this method returns a valid InputStream,Payload.writeTo(java.io.OutputStream)
will never be called.- Specified by:
readFrom
in interfacePayload
- Throws:
IOException
-
writeTo
public void writeTo(OutputStream out) throws IOException
Description copied from interface:Payload
Writes the payload data to the given OutputStream. IfPayload.readFrom()
returnsnull
, this method must be implemented.- Specified by:
writeTo
in interfacePayload
- Parameters:
out
- non-null
output stream to which to write the payload data- Throws:
IOException
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
getMetadata
public PayloadMetadata getMetadata()
Description copied from interface:ExtendedPayload
Returns a valid PayloadMetadata for this payload, ornull
if no metadata is provided.- Specified by:
getMetadata
in interfaceExtendedPayload
-
-