org.jclouds.io.payloads
Class ByteSourcePayload

java.lang.Object
  extended by org.jclouds.io.payloads.BasePayload<com.google.common.io.ByteSource>
      extended by org.jclouds.io.payloads.ByteSourcePayload
All Implemented Interfaces:
com.google.common.io.InputSupplier<InputStream>, Closeable, Payload

public class ByteSourcePayload
extends BasePayload<com.google.common.io.ByteSource>

A repeatable, ByteSource-backed Payload.


Field Summary
 
Fields inherited from class org.jclouds.io.payloads.BasePayload
content, contentMetadata, written
 
Constructor Summary
ByteSourcePayload(com.google.common.io.ByteSource content)
           
 
Method Summary
 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, setContentMetadata, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ByteSourcePayload

public ByteSourcePayload(com.google.common.io.ByteSource content)
Method Detail

openStream

public InputStream openStream()
                       throws IOException
Description copied from interface: Payload
Creates a new InputStream object of the payload.

Throws:
IOException

isRepeatable

public boolean isRepeatable()
Description copied from class: BasePayload
By default we are repeatable.

Specified by:
isRepeatable in interface Payload
Overrides:
isRepeatable in class BasePayload<com.google.common.io.ByteSource>

release

public void release()
if we created the stream, then it is already consumed on close.

Specified by:
release in interface Payload
Overrides:
release in class BasePayload<com.google.common.io.ByteSource>


Copyright © 2009-2014 The Apache Software Foundation. All Rights Reserved.