X-Git-Url: http://git.nikiroo.be/?a=blobdiff_plain;ds=sidebyside;f=src%2Fbe%2Fnikiroo%2Futils%2FImage.java;h=4518577d640b684bee939381e02b9aa745b2d3a2;hb=aa9c3626f962e59ac7460d8ac6645a6e30a4d248;hp=58c0e1019204ea2e3a35647754164b57653e7684;hpb=805005449dacb1e7b825db63836bf100e472ddd0;p=nikiroo-utils.git diff --git a/src/be/nikiroo/utils/Image.java b/src/be/nikiroo/utils/Image.java deleted file mode 100644 index 58c0e10..0000000 --- a/src/be/nikiroo/utils/Image.java +++ /dev/null @@ -1,78 +0,0 @@ -package be.nikiroo.utils; - -import java.io.IOException; -import java.io.InputStream; - -/** - * This class represents an image data. - * - * @author niki - */ -public class Image { - private byte[] data; - - /** - * Do not use -- for serialisation purposes only. - */ - @SuppressWarnings("unused") - private Image() { - } - - /** - * Create a new {@link Image} with the given data. - * - * @param data - * the data - */ - public Image(byte[] data) { - this.data = data; - } - - /** - * Create a new {@link Image} from its Base64 representation. - * - * @param base64 - * the {@link Image} in Base64 format - * - * @throws IOException - * in case of I/O error - */ - public Image(String base64) throws IOException { - this(Base64.decode(base64)); - } - - /** - * Create a new {@link Image} from a stream. - * - * @param in - * the stream - * - * @throws IOException - * in case of I/O error - */ - public Image(InputStream in) throws IOException { - this.data = IOUtils.toByteArray(in); - } - - /** - * The actual image data. - *

- * This is the actual data, not a copy, so any change made here will be - * reflected into the {@link Image} and vice-versa. - * - * @return the image data - */ - public byte[] getData() { - return data; - } - - /** - * Convert the given {@link Image} object into a Base64 representation of - * the same {@link Image} object. - * - * @return the Base64 representation - */ - public String toBase64() { - return new String(Base64.encodeBytes(getData())); - } -}