本文整理匯總了Java中com.sun.media.jai.codec.ByteArraySeekableStream類的典型用法代碼示例。如果您正苦於以下問題:Java ByteArraySeekableStream類的具體用法?Java ByteArraySeekableStream怎麽用?Java ByteArraySeekableStream使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ByteArraySeekableStream類屬於com.sun.media.jai.codec包,在下文中一共展示了ByteArraySeekableStream類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getImage
import com.sun.media.jai.codec.ByteArraySeekableStream; //導入依賴的package包/類
/** @param id unique id given to the image
*/
public RenderedOp getImage(String id)
throws ImageStorageException
{
try {
File f = new File(folder+"sign_"+id+".tif");
FileInputStream is = new FileInputStream(f);
byte[] b = new byte[(new Long(f.length())).intValue()];
is.read(b);
ByteArraySeekableStream stream = new ByteArraySeekableStream(b);
RenderedOp img = JAI.create("stream",stream);
is.close();
return img;
}
catch(FileNotFoundException e1) {
throw new ImageStorageException
("File "+folder+"sign_"+id+".tif not found");
}
catch(IOException e2) {
throw new ImageStorageException
("Class FolderImageStorage : IOException throwed : msg : "+e2.getMessage());
}
}
示例2: loadImageFromBytes
import com.sun.media.jai.codec.ByteArraySeekableStream; //導入依賴的package包/類
public static RenderedImage loadImageFromBytes(byte[] bytes) throws IOException {
SeekableStream ss = new ByteArraySeekableStream(bytes);
RenderedImage image = JAI.create("stream", ss);
return image;
}