package zello

import java.io.ByteArrayOutputStream

/**
 * Zello Image Receiving Job
 * @param channel The channel name where the image is received
 * @param messageID The unique identifier for the image message
 * @param height The height of the image (some clients dont provide this value)
 * @param width The width of the image (some clients dont provide this value)
 * @param source The source of the image ("camera" or "library")
 * @param from The sender of the image
 * @param For The recipient of the image (optional, if it was sent with "for" parameter)
 */
@Suppress("unused")
class ZelloImageJob(val channel: String, val messageID: Int, val height: Int, val width: Int, val source:String, val from: String, val For: String?=null) {
    val type = "jpeg" // Default image type
    private val thumbnailbaos = ByteArrayOutputStream()
    private val fullbaos = ByteArrayOutputStream()
    fun pushThumbnail(data: ByteArray) {
        thumbnailbaos.write(data)
    }
    fun pushFull(data: ByteArray) {
        fullbaos.write(data)
    }
    fun getThumbnail(): ByteArray {
        return thumbnailbaos.toByteArray()
    }
    fun getFull(): ByteArray {
        return fullbaos.toByteArray()
    }
}