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

com.yoti.api.client.spi.remote.ImageAttributeValue Maven / Gradle / Ivy

The newest version!
package com.yoti.api.client.spi.remote;

import static org.bouncycastle.util.encoders.Base64.toBase64String;

import com.yoti.api.client.Image;

/**
 * Image attribute values.
 */
abstract class ImageAttributeValue implements Image {

    /**
     * Get mime type of the content.
     *
     * @return mime type
     */
    @Override
    public abstract String getMimeType();

    /**
     * Image content.
     *
     * @return image as byte[]
     */
    @Override
    public abstract byte[] getContent();

    @Override
    public String getBase64Content() {
        return String.format("data:%s;base64,%s", getMimeType(), toBase64String(getContent()));
    }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy