ImageAssembler.java
上传用户:sh2222
上传日期:2009-12-31
资源大小:84k
文件大小:1k
源码类别:

J2ME

开发平台:

Java

  1. package paopao;
  2. import com.nokia.mid.ui.DirectGraphics;
  3. import com.nokia.mid.ui.DirectUtils;
  4. import java.io.InputStream;
  5. import java.io.PrintStream;
  6. import javax.microedition.lcdui.Image;
  7. public class ImageAssembler{
  8.   public static Image createMutableImage(String s, int i)
  9.          throws IllegalArgumentException
  10.      {
  11.          byte abyte0[] = new byte[i];
  12.          try
  13.          {
  14.              InputStream inputstream = Runtime.getRuntime().getClass().getResourceAsStream(s);
  15.              inputstream.read(abyte0, 0, i);
  16.              inputstream.close();
  17.          }
  18.          catch(Exception exception)
  19.          {
  20.              throw new IllegalArgumentException("IOException!");
  21.          }
  22.          return DirectUtils.createImage(abyte0, 0, i);
  23.      }
  24. }