com.bumptech.glide.load.resource
Class NullResourceEncoder<T>

java.lang.Object
  extended by com.bumptech.glide.load.resource.NullResourceEncoder<T>
Type Parameters:
T - The type of the resource that will always fail to be encoded.
All Implemented Interfaces:
Encoder<Resource<T>>, ResourceEncoder<T>

public class NullResourceEncoder<T>
extends Object
implements ResourceEncoder<T>

A simple ResourceEncoder that never writes data.


Constructor Summary
NullResourceEncoder()
           
 
Method Summary
 boolean encode(Resource<T> data, OutputStream os)
          Writes the given data to the given output stream and returns True if the write completed successfully and should be committed.
static
<T> NullResourceEncoder<T>
get()
          Returns a NullResourceEncoder for the given type.
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NullResourceEncoder

public NullResourceEncoder()
Method Detail

get

public static <T> NullResourceEncoder<T> get()
Returns a NullResourceEncoder for the given type.

Type Parameters:
T - The type of data to be written (or in this case not written).

encode

public boolean encode(Resource<T> data,
                      OutputStream os)
Description copied from interface: Encoder
Writes the given data to the given output stream and returns True if the write completed successfully and should be committed.

Specified by:
encode in interface Encoder<Resource<T>>
Parameters:
data - The data to write.
os - The OutputStream to write the data to.

getId

public String getId()
Description copied from interface: Encoder
Returns an ID identifying any transformation this encoder may apply to the given data that will be mixed in to the cache key.

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.

Specified by:
getId in interface Encoder<Resource<T>>