74 |
this.url = url; |
this.url = url; |
75 |
} |
} |
76 |
|
|
77 |
|
public ImageDecoder (InputStream is) |
78 |
|
{ |
79 |
|
this.input = is; |
80 |
|
} |
81 |
|
|
82 |
public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength) |
public ImageDecoder (byte[] imagedata, int imageoffset, int imagelength) |
83 |
{ |
{ |
84 |
data = imagedata; |
data = imagedata; |
113 |
// ImageDecoder constructors so that exceptions cause |
// ImageDecoder constructors so that exceptions cause |
114 |
// imageComplete to be called with an appropriate error |
// imageComplete to be called with an appropriate error |
115 |
// status. |
// status. |
116 |
if (url != null) |
if (input == null) |
117 |
input = url.openStream(); |
{ |
118 |
else |
try |
119 |
{ |
{ |
120 |
if (filename != null) |
if (url != null) |
121 |
input = new FileInputStream (filename); |
input = url.openStream(); |
122 |
else |
else |
123 |
input = new ByteArrayInputStream (data, offset, length); |
{ |
124 |
} |
if (filename != null) |
125 |
|
input = new FileInputStream (filename); |
126 |
produce (list, input); |
else |
127 |
|
input = new ByteArrayInputStream (data, offset, length); |
128 |
|
} |
129 |
|
produce (list, input); |
130 |
|
} |
131 |
|
finally |
132 |
|
{ |
133 |
|
input = null; |
134 |
|
} |
135 |
|
} |
136 |
|
else |
137 |
|
{ |
138 |
|
produce (list, input); |
139 |
|
} |
140 |
} |
} |
141 |
catch (Exception e) |
catch (Exception e) |
142 |
{ |
{ |