All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.bumptech.glide.load.resource.NullEncoder Maven / Gradle / Ivy

Go to download

A fast and efficient image loading library for Android focused on smooth scrolling.

There is a newer version: 5.0.0-rc01
Show newest version
package com.bumptech.glide.load.resource;

import com.bumptech.glide.load.Encoder;

import java.io.OutputStream;

/**
 * A simple {@link com.bumptech.glide.load.Encoder} that never writes data.
 *
 * @param  type discarded by this Encoder
 */
public class NullEncoder implements Encoder {
    private static final NullEncoder NULL_ENCODER = new NullEncoder();

    /**
     * Returns an Encoder for the given data type.
     *
     * @param  The type of data to be written (or not in this case).
     */
    @SuppressWarnings("unchecked")
    public static  Encoder get() {
        return (Encoder) NULL_ENCODER;

    }

    @Override
    public boolean encode(T data, OutputStream os) {
        return false;
    }

    @Override
    public String getId() {
        return "";
    }
}