use of com.bumptech.glide.load.resource.bytes.BytesResource in project glide by bumptech.
the class BitmapBytesTranscoder method transcode.
@Override
public Resource<byte[]> transcode(Resource<Bitmap> toTranscode) {
ByteArrayOutputStream os = new ByteArrayOutputStream();
toTranscode.get().compress(compressFormat, quality, os);
toTranscode.recycle();
return new BytesResource(os.toByteArray());
}
use of com.bumptech.glide.load.resource.bytes.BytesResource in project glide by bumptech.
the class GifDrawableBytesTranscoder method transcode.
@Override
public Resource<byte[]> transcode(Resource<GifDrawable> toTranscode) {
GifDrawable gifData = toTranscode.get();
ByteBuffer byteBuffer = gifData.getBuffer();
return new BytesResource(ByteBufferUtil.toBytes(byteBuffer));
}
Aggregations