public class ImageVideoWrapperEncoder extends Object implements Encoder<ImageVideoWrapper>
ImageVideoWrapper
to disk by preferentially
writing data from the wrapper's InputStream
and falling back to the wrapper's
ParcelFileDescriptor
if the InputStream
isn't available.Constructor and Description |
---|
ImageVideoWrapperEncoder(Encoder<InputStream> streamEncoder,
Encoder<ParcelFileDescriptor> fileDescriptorEncoder) |
Modifier and Type | Method and Description |
---|---|
boolean |
encode(ImageVideoWrapper data,
OutputStream os)
Writes the given data to the given output stream and returns True if the write completed successfully and
should be committed.
|
String |
getId()
Returns an ID identifying any transformation this encoder may apply to the given data that will be mixed in to
the cache key.
|
public ImageVideoWrapperEncoder(Encoder<InputStream> streamEncoder, Encoder<ParcelFileDescriptor> fileDescriptorEncoder)
public boolean encode(ImageVideoWrapper data, OutputStream os)
Encoder
encode
in interface Encoder<ImageVideoWrapper>
data
- The data to write.os
- The OutputStream to write the data to.public String getId()
Encoder
If the encoder does not transform the data in a way that significantly affects the cached result (ie performs no unusual compression or downsampling) an empty string is an appropriate id.
getId
in interface Encoder<ImageVideoWrapper>