Package org.jclouds.io.internal
Class BasePayloadSlicer
java.lang.Object
org.jclouds.io.internal.BasePayloadSlicer
- All Implemented Interfaces:
PayloadSlicer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Payload
copyMetadataAndSetLength
(Payload input, Payload returnVal, long length) protected Payload
doSlice
(byte[] content, long offset, long length) doSlice
(byte[] rawContent, ContentMetadata meta) protected Payload
doSlice
(com.google.common.io.ByteSource content, long offset, long length) doSlice
(com.google.common.io.ByteSource rawContent, ContentMetadata meta) protected Payload
doSlice
(File rawContent, ContentMetadata meta) protected Payload
doSlice
(InputStream content, long offset, long length) doSlice
(InputStream rawContent, ContentMetadata meta) protected Payload
doSlice
(String rawContent, ContentMetadata meta) protected Payload
doSlice
(Payload input, ContentMetadata meta) Returns aPayload
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.
-
Constructor Details
-
BasePayloadSlicer
public BasePayloadSlicer()
-
-
Method Details
-
slice
Returns aPayload
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 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
-
doSlice
-
doSlice
-
doSlice
-
doSlice
-
doSlice
-
copyMetadataAndSetLength
-
slice
Description copied from interface:PayloadSlicer
- Specified by:
slice
in interfacePayloadSlicer
- Parameters:
input
- thePayload
to be slicedsize
- the maximum size of each slice- Returns:
- an
Iterable
ofPayload
instances
-
doSlice
-
doSlice
-
doSlice
-
doSlice
-
doSlice
-
doSlice
protected Iterable<Payload> doSlice(com.google.common.io.ByteSource rawContent, ContentMetadata meta)
-