/[classpath]/classpath/gnu/java/awt/image/ImageDecoder.java
ViewVC logotype

Diff of /classpath/gnu/java/awt/image/ImageDecoder.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.12.2.3 by gnu_andrew, Tue Aug 2 20:12:09 2005 UTC revision 1.12.2.4 by gnu_andrew, Sun Nov 27 21:00:36 2005 UTC
# Line 40  package gnu.java.awt.image; Line 40  package gnu.java.awt.image;
40  import java.awt.image.ImageConsumer;  import java.awt.image.ImageConsumer;
41  import java.awt.image.ImageProducer;  import java.awt.image.ImageProducer;
42  import java.io.ByteArrayInputStream;  import java.io.ByteArrayInputStream;
43    import java.io.DataInput;
44    import java.io.EOFException;
45  import java.io.FileInputStream;  import java.io.FileInputStream;
46  import java.io.IOException;  import java.io.IOException;
47  import java.io.InputStream;  import java.io.InputStream;
# Line 55  public abstract class ImageDecoder imple Line 57  public abstract class ImageDecoder imple
57    int offset;    int offset;
58    int length;    int length;
59    InputStream input;    InputStream input;
60      DataInput datainput;
61    
62    static    static
63    {    {
# Line 79  public abstract class ImageDecoder imple Line 82  public abstract class ImageDecoder imple
82      this.input = is;      this.input = is;
83    }    }
84    
85      public ImageDecoder (DataInput datainput)
86      {
87        this.datainput = datainput;
88      }
89    
90    public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)    public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength)
91    {    {
92      data = imagedata;      data = imagedata;
# Line 119  public abstract class ImageDecoder imple Line 127  public abstract class ImageDecoder imple
127                {                {
128                  if (url != null)                  if (url != null)
129                    input = url.openStream();                    input = url.openStream();
130                    else if (datainput != null)
131                      input = new DataInputStreamWrapper(datainput);
132                  else                  else
133                    {                    {
134                      if (filename != null)                      if (filename != null)
# Line 153  public abstract class ImageDecoder imple Line 163  public abstract class ImageDecoder imple
163    }    }
164    
165    public abstract void produce (Vector v, InputStream is) throws IOException;    public abstract void produce (Vector v, InputStream is) throws IOException;
166    
167      private static class DataInputStreamWrapper extends InputStream
168      {
169        private final DataInput datainput;
170    
171        DataInputStreamWrapper(DataInput datainput)
172        {
173          this.datainput = datainput;
174        }
175    
176        public int read() throws IOException
177        {
178          try
179            {
180              return datainput.readByte() & 0xFF;
181            }
182          catch (EOFException eofe)
183            {
184              return -1;
185            }
186        }
187      }
188  }  }

Legend:
Removed from v.1.12.2.3  
changed lines
  Added in v.1.12.2.4

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26