register

open fun <Data> register(dataClass: Class<Data>, encoder: Encoder<Data>): Registry

Registers the given Encoder for the given data class (InputStream, FileDescriptor etc).

The Encoder will be used both for the exact data class and any subtypes. For example, registering an Encoder for java.io.InputStream will result in the Encoder being used for , java.io.FileInputStream and any other subclass.

If multiple Encoders are registered for the same type or super type, the that is registered first will be used.

Deprecated

Use the equivalent append method instead.


open fun <TResource> register(resourceClass: Class<TResource>, encoder: ResourceEncoder<TResource>): Registry

Appends the given ResourceEncoder into the list of available ResourceEncoders so that it is attempted after all earlier and default ResourceEncoders for the given data type.

The ResourceEncoder will be used both for the exact resource class and any subtypes. For example, registering an ResourceEncoder for (not recommended) will result in the being used for android.graphics.drawable.BitmapDrawable and and any other subclass.

If multiple ResourceEncoders are registered for the same type or super type, the ResourceEncoder that is registered first will be used.

Deprecated

Use the equivalent append method instead.


open fun register(factory: DataRewinder.Factory<out Any>): Registry

Registers a new com.bumptech.glide.load.data.DataRewinder.Factory to handle a non-default data type that can be rewind to allow for efficient reads of file headers.


open fun <TResource, Transcode> register(    resourceClass: Class<TResource>,     transcodeClass: Class<Transcode>,     transcoder: ResourceTranscoder<TResource, Transcode>): Registry

Registers the given ResourceTranscoder to convert from the given resource Class to the given transcode Class.

Parameters

resourceClass

The class that will be transcoded from (e.g. ).

transcodeClass

The class that will be transcoded to (e.g. ).

transcoder

The ResourceTranscoder to register.


open fun register(parser: ImageHeaderParser): Registry

Registers a new ImageHeaderParser that can obtain some basic metadata from an image header (orientation, type etc).