我可以得到图形文件的InputStream,要把它转化成Image,在Applet画出来,我要怎样实现?

解决方案 »

  1.   

    public ImageIcon(byte[] imageData)或者用这个构造函数 用字节数组图像ImageIcon image = new  ImageIcon(in.readBytes(new byte[in.available()]))
      

  2.   

    InputStream is = null;
            byte[] bb=new byte[is.available()];
            is.read(bb);
            ByteArrayImageSource bais = new ByteArrayImageSource(bb);
            Image image = new ToolkitImage(bais);觉着有点麻烦,看还有什么好点的方法没?