Class BytesResource
java.lang.Object
com.bumptech.glide.load.resource.bytes.BytesResource
- All Implemented Interfaces:
Resource<byte[]>
An
Resource wrapping a byte array.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]get()In most cases it will only be retrieved once (see linked methods).Class<byte[]>Returns theClassof the wrapped resource.intgetSize()Returns the size in bytes of the wrapped resource to use to determine how much of the memory cache this resource uses.voidrecycle()Cleans up and recycles internal resources.
-
Constructor Details
-
BytesResource
public BytesResource(byte[] bytes)
-
-
Method Details
-
getResourceClass
Description copied from interface:ResourceReturns theClassof the wrapped resource.- Specified by:
getResourceClassin interfaceResource<byte[]>
-
get
@NonNull public byte[] get()In most cases it will only be retrieved once (see linked methods). -
getSize
public int getSize()Description copied from interface:ResourceReturns the size in bytes of the wrapped resource to use to determine how much of the memory cache this resource uses. -
recycle
public void recycle()Description copied from interface:ResourceCleans up and recycles internal resources.It is only safe to call this method if there are no current resource consumers and if this method has not yet been called. Typically this occurs at one of two times:
- During a resource load when the resource is transformed or transcoded before any consumer have ever had access to this resource
- After all consumers have released this resource and it has been evicted from the cache
-