Package org.jclouds.io.payloads
Class InputStreamPayload
- java.lang.Object
-
- org.jclouds.io.payloads.BasePayload<InputStream>
-
- org.jclouds.io.payloads.InputStreamPayload
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Payload
public class InputStreamPayload extends BasePayload<InputStream>
-
-
Field Summary
-
Fields inherited from class org.jclouds.io.payloads.BasePayload
content, contentMetadata, written
-
-
Constructor Summary
Constructors Constructor Description InputStreamPayload(InputStream content)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
isRepeatable()
By default we are repeatable.InputStream
openStream()
Creates a new InputStream object of the payload.void
release()
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 Detail
-
InputStreamPayload
public InputStreamPayload(InputStream content)
-
-
Method Detail
-
openStream
public InputStream openStream()
Creates a new InputStream object of the payload.
-
isRepeatable
public boolean isRepeatable()
By default we are repeatable.- Specified by:
isRepeatable
in interfacePayload
- Overrides:
isRepeatable
in classBasePayload<InputStream>
-
release
public void release()
if we created the stream, then it is already consumed on close.- Specified by:
release
in interfacePayload
- Overrides:
release
in classBasePayload<InputStream>
-
-