org.jclouds.io.internal
Class BasePayloadSlicer

java.lang.Object
  extended by org.jclouds.io.internal.BasePayloadSlicer
All Implemented Interfaces:
PayloadSlicer
Direct Known Subclasses:
NettyPayloadSlicer

@Singleton
public class BasePayloadSlicer
extends Object
implements PayloadSlicer

Author:
Adrian Cole

Constructor Summary
BasePayloadSlicer()
           
 
Method Summary
protected  Payload copyMetadataAndSetLength(Payload input, Payload returnVal, long length)
           
protected  Payload doSlice(byte[] content, long offset, long length)
           
protected  Payload doSlice(File content, long offset, long length)
           
protected  Payload doSlice(InputStream content, long offset, long length)
           
protected  Payload doSlice(Payload content, long offset, long length)
           
protected  Payload doSlice(String content, long offset, long length)
           
 Payload slice(Payload input, long offset, long length)
          Returns a Payload that returns input streams from the an underlying payload, where each stream starts at the given offset and is limited to the specified number of bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePayloadSlicer

public BasePayloadSlicer()
Method Detail

slice

public Payload slice(Payload input,
                     long offset,
                     long length)
Returns a Payload that returns input streams from the an underlying payload, where each stream starts at the given offset and is limited to the specified number of bytes.

Specified by:
slice in interface PayloadSlicer
Parameters:
input - the payload from which to get the raw streams
offset - the offset in bytes into the underlying stream where the returned streams will start
length - the maximum length of the returned streams

doSlice

protected Payload doSlice(Payload content,
                          long offset,
                          long length)

doSlice

protected Payload doSlice(String content,
                          long offset,
                          long length)

doSlice

protected Payload doSlice(File content,
                          long offset,
                          long length)

doSlice

protected Payload doSlice(InputStream content,
                          long offset,
                          long length)

doSlice

protected Payload doSlice(byte[] content,
                          long offset,
                          long length)

copyMetadataAndSetLength

protected Payload copyMetadataAndSetLength(Payload input,
                                           Payload returnVal,
                                           long length)


Copyright © 2009-2011 jclouds. All Rights Reserved.