1 22 23 package de.laures.cewolf.storage; 24 25 import java.io.Serializable ; 26 import java.util.Date ; 27 28 import de.laures.cewolf.CewolfException; 29 import de.laures.cewolf.ChartImage; 30 31 35 public class SerializableChartImage implements ChartImage, Serializable { 36 37 private final int width; 38 private final int height; 39 private final int type; 40 private final Date timeoutTime; 41 private final String mimeType; 42 private final byte[] data; 43 44 public SerializableChartImage(ChartImage img) throws CewolfException{ 45 this.width = img.getWidth(); 46 this.height = img.getHeight(); 47 this.type = img.getType(); 48 this.mimeType = img.getMimeType(); 49 this.data = img.getBytes(); 50 this.timeoutTime = img.getTimeoutTime(); 51 } 52 53 56 public int getWidth() { 57 return width; 58 } 59 60 63 public int getHeight() { 64 return height; 65 } 66 67 70 public int getType() { 71 return type; 72 } 73 74 77 public byte[] getBytes() throws CewolfException { 78 return data; 79 } 80 81 84 public String getMimeType() { 85 return mimeType; 86 } 87 88 91 public int getSize() throws CewolfException { 92 return data.length; 93 } 94 95 98 public Date getTimeoutTime() { 99 return timeoutTime; 100 } 101 102 } 103 | Popular Tags |