Package org.jclouds.io.payloads
Class ByteSourcePayload
java.lang.Object
org.jclouds.io.payloads.BasePayload<com.google.common.io.ByteSource>
org.jclouds.io.payloads.ByteSourcePayload
- All Implemented Interfaces:
Closeable,AutoCloseable,Payload
A repeatable, ByteSource-backed Payload.
-
Field Summary
Fields inherited from class org.jclouds.io.payloads.BasePayload
content, contentMetadata, written -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanBy default we are repeatable.Creates a new InputStream object of the payload.voidrelease()if we created the stream, then it is already consumed on close.Methods inherited from class org.jclouds.io.payloads.BasePayload
close, equals, getContentMetadata, getInput, getRawContent, hashCode, isSensitive, setContentMetadata, setSensitive, toString
-
Constructor Details
-
ByteSourcePayload
public ByteSourcePayload(com.google.common.io.ByteSource content)
-
-
Method Details
-
openStream
Description copied from interface:PayloadCreates a new InputStream object of the payload.- Throws:
IOException
-
isRepeatable
public boolean isRepeatable()Description copied from class:BasePayloadBy default we are repeatable.- Specified by:
isRepeatablein interfacePayload- Overrides:
isRepeatablein classBasePayload<com.google.common.io.ByteSource>
-
release
public void release()if we created the stream, then it is already consumed on close.- Specified by:
releasein interfacePayload- Overrides:
releasein classBasePayload<com.google.common.io.ByteSource>
-