package com.bumptech.glide.load.resource; import com.bumptech.glide.load.ResourceEncoder; import com.bumptech.glide.load.engine.Resource; import java.io.OutputStream; /** * A simple {@link com.bumptech.glide.load.ResourceEncoder} that never writes data. * * @param The type of the resource that will always fail to be encoded. */ public class NullResourceEncoder implements ResourceEncoder { private static final NullResourceEncoder NULL_ENCODER = new NullResourceEncoder(); /** * Returns a NullResourceEncoder for the given type. * * @param The type of data to be written (or in this case not written). */ @SuppressWarnings("unchecked") public static NullResourceEncoder get() { return (NullResourceEncoder) NULL_ENCODER; } @Override public boolean encode(Resource data, OutputStream os) { return false; } @Override public String getId() { return ""; } }