ImageAssembler.java
资源名称:PaoPao.rar [点击查看]
上传用户:sh2222
上传日期:2009-12-31
资源大小:84k
文件大小:1k
源码类别:
J2ME
开发平台:
Java
- package paopao;
- import com.nokia.mid.ui.DirectGraphics;
- import com.nokia.mid.ui.DirectUtils;
- import java.io.InputStream;
- import java.io.PrintStream;
- import javax.microedition.lcdui.Image;
- public class ImageAssembler{
- public static Image createMutableImage(String s, int i)
- throws IllegalArgumentException
- {
- byte abyte0[] = new byte[i];
- try
- {
- InputStream inputstream = Runtime.getRuntime().getClass().getResourceAsStream(s);
- inputstream.read(abyte0, 0, i);
- inputstream.close();
- }
- catch(Exception exception)
- {
- throw new IllegalArgumentException("IOException!");
- }
- return DirectUtils.createImage(abyte0, 0, i);
- }
- }