Package org.jclouds.io.internal
Class BasePayloadSlicer
- java.lang.Object
-
- org.jclouds.io.internal.BasePayloadSlicer
-
- All Implemented Interfaces:
PayloadSlicer
- Direct Known Subclasses:
NettyPayloadSlicer
@Singleton public class BasePayloadSlicer extends Object implements PayloadSlicer
-
-
Constructor Summary
Constructors Constructor Description BasePayloadSlicer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected PayloadcopyMetadataAndSetLength(Payload input, Payload returnVal, long length)protected PayloaddoSlice(byte[] content, long offset, long length)protected Iterable<Payload>doSlice(byte[] rawContent, ContentMetadata meta)protected PayloaddoSlice(com.google.common.io.ByteSource content, long offset, long length)protected Iterable<Payload>doSlice(com.google.common.io.ByteSource rawContent, ContentMetadata meta)protected PayloaddoSlice(File content, long offset, long length)protected Iterable<Payload>doSlice(File rawContent, ContentMetadata meta)protected PayloaddoSlice(InputStream content, long offset, long length)protected Iterable<Payload>doSlice(InputStream rawContent, ContentMetadata meta)protected PayloaddoSlice(String content, long offset, long length)protected Iterable<Payload>doSlice(String rawContent, ContentMetadata meta)protected PayloaddoSlice(Payload content, long offset, long length)protected Iterable<Payload>doSlice(Payload input, ContentMetadata meta)Iterable<Payload>slice(Payload input, long size)Payloadslice(Payload input, long offset, long length)Returns aPayloadthat 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.
-
-
-
Method Detail
-
slice
public Payload slice(Payload input, long offset, long length)
Returns aPayloadthat 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:
slicein interfacePayloadSlicer- Parameters:
input- the payload from which to get the raw streamsoffset- the offset in bytes into the underlying stream where the returned streams will startlength- the maximum length of the returned streams
-
doSlice
protected Payload doSlice(InputStream content, long offset, long length)
-
doSlice
protected Payload doSlice(com.google.common.io.ByteSource 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)
-
slice
public Iterable<Payload> slice(Payload input, long size)
Description copied from interface:PayloadSlicer- Specified by:
slicein interfacePayloadSlicer- Parameters:
input- thePayloadto be slicedsize- the maximum size of each slice- Returns:
- an
IterableofPayloadinstances
-
doSlice
protected Iterable<Payload> doSlice(Payload input, ContentMetadata meta)
-
doSlice
protected Iterable<Payload> doSlice(String rawContent, ContentMetadata meta)
-
doSlice
protected Iterable<Payload> doSlice(byte[] rawContent, ContentMetadata meta)
-
doSlice
protected Iterable<Payload> doSlice(File rawContent, ContentMetadata meta)
-
doSlice
protected Iterable<Payload> doSlice(InputStream rawContent, ContentMetadata meta)
-
doSlice
protected Iterable<Payload> doSlice(com.google.common.io.ByteSource rawContent, ContentMetadata meta)
-
-