@Singleton public class BasePayloadSlicer extends Object implements PayloadSlicer
Constructor and Description |
---|
BasePayloadSlicer() |
Modifier and Type | Method and Description |
---|---|
protected Payload |
copyMetadataAndSetLength(Payload input,
Payload returnVal,
long length) |
protected Iterable<Payload> |
doSlice(byte[] rawContent,
ContentMetadata meta) |
protected Payload |
doSlice(byte[] content,
long offset,
long length) |
protected Iterable<Payload> |
doSlice(com.google.common.io.ByteSource rawContent,
ContentMetadata meta) |
protected Payload |
doSlice(com.google.common.io.ByteSource content,
long offset,
long length) |
protected Iterable<Payload> |
doSlice(File rawContent,
ContentMetadata meta) |
protected Payload |
doSlice(File content,
long offset,
long length) |
protected Iterable<Payload> |
doSlice(InputStream rawContent,
ContentMetadata meta) |
protected Payload |
doSlice(InputStream content,
long offset,
long length) |
protected Iterable<Payload> |
doSlice(Payload input,
ContentMetadata meta) |
protected Payload |
doSlice(Payload content,
long offset,
long length) |
protected Iterable<Payload> |
doSlice(String rawContent,
ContentMetadata meta) |
protected Payload |
doSlice(String content,
long offset,
long length) |
Iterable<Payload> |
slice(Payload input,
long size)
|
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. |
public Payload slice(Payload input, long offset, long length)
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.slice
in interface PayloadSlicer
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 streamsprotected Payload doSlice(InputStream content, long offset, long length)
protected Payload doSlice(com.google.common.io.ByteSource content, long offset, long length)
protected Payload doSlice(byte[] content, long offset, long length)
protected Payload copyMetadataAndSetLength(Payload input, Payload returnVal, long length)
public Iterable<Payload> slice(Payload input, long size)
PayloadSlicer
slice
in interface PayloadSlicer
input
- the Payload
to be slicedsize
- the maximum size of each sliceIterable
of Payload
instancesprotected Iterable<Payload> doSlice(Payload input, ContentMetadata meta)
protected Iterable<Payload> doSlice(String rawContent, ContentMetadata meta)
protected Iterable<Payload> doSlice(byte[] rawContent, ContentMetadata meta)
protected Iterable<Payload> doSlice(File rawContent, ContentMetadata meta)
protected Iterable<Payload> doSlice(InputStream rawContent, ContentMetadata meta)
protected Iterable<Payload> doSlice(com.google.common.io.ByteSource rawContent, ContentMetadata meta)
Copyright © 2009-2016 The Apache Software Foundation. All Rights Reserved.