File tree 2 files changed +8
-3
lines changed
org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/graphics
org.eclipse.swt.svg/src/org/eclipse/swt/svg
2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -165,7 +165,12 @@ public boolean isSVGFile(InputStream stream) throws IOException {
165
165
if (stream == null ) {
166
166
throw new IllegalArgumentException ("InputStream cannot be null" );
167
167
}
168
- int firstByte = inputStream .read ();
169
- return firstByte == '<' ;
168
+ stream .mark (Integer .MAX_VALUE );
169
+ try {
170
+ int firstByte = stream .read ();
171
+ return firstByte == '<' ;
172
+ } finally {
173
+ stream .reset ();
174
+ }
170
175
}
171
176
}
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ public interface SVGRasterizer {
37
37
/**
38
38
* Determines whether the given {@link InputStream} contains a SVG file.
39
39
*
40
- * @param inputStream the input stream to check.
40
+ * @param stream the input stream to check.
41
41
* @return {@code true} if the input stream contains SVG content; {@code false}
42
42
* otherwise.
43
43
* @throws IOException if an error occurs while reading the stream.
You can’t perform that action at this time.
0 commit comments