Lines 18-28
Link Here
|
18 |
package org.apache.tomcat.util.bcel.classfile; |
18 |
package org.apache.tomcat.util.bcel.classfile; |
19 |
|
19 |
|
20 |
import java.io.BufferedInputStream; |
20 |
import java.io.BufferedInputStream; |
|
|
21 |
import java.io.DataInput; |
21 |
import java.io.DataInputStream; |
22 |
import java.io.DataInputStream; |
22 |
import java.io.IOException; |
23 |
import java.io.IOException; |
23 |
import java.io.InputStream; |
24 |
import java.io.InputStream; |
24 |
|
25 |
|
25 |
import org.apache.tomcat.util.bcel.Constants; |
26 |
import org.apache.tomcat.util.bcel.Constants; |
|
|
27 |
import org.apache.tomcat.util.bcel.util.FastDataInputStream; |
26 |
|
28 |
|
27 |
/** |
29 |
/** |
28 |
* Wrapper class that parses a given Java .class file. The method <A |
30 |
* Wrapper class that parses a given Java .class file. The method <A |
Lines 40-48
Link Here
|
40 |
*/ |
42 |
*/ |
41 |
public final class ClassParser { |
43 |
public final class ClassParser { |
42 |
|
44 |
|
|
|
45 |
//switch for FastDataInputStream |
46 |
public static boolean isFDIS = true; |
47 |
|
43 |
private static final int MAGIC = 0xCAFEBABE; |
48 |
private static final int MAGIC = 0xCAFEBABE; |
44 |
|
49 |
|
45 |
private final DataInputStream file; |
50 |
private final DataInput file; |
46 |
private String class_name, superclass_name; |
51 |
private String class_name, superclass_name; |
47 |
private int access_flags; // Access rights of parsed class |
52 |
private int access_flags; // Access rights of parsed class |
48 |
private String[] interface_names; // Names of implemented interfaces |
53 |
private String[] interface_names; // Names of implemented interfaces |
Lines 58-64
Link Here
|
58 |
* @param file Input stream |
63 |
* @param file Input stream |
59 |
*/ |
64 |
*/ |
60 |
public ClassParser(InputStream file) { |
65 |
public ClassParser(InputStream file) { |
61 |
this.file = new DataInputStream(new BufferedInputStream(file, BUFSIZE)); |
66 |
if(isFDIS){ |
|
|
67 |
this.file = new FastDataInputStream(file, BUFSIZE); |
68 |
} else |
69 |
this.file = new DataInputStream(new BufferedInputStream(file, BUFSIZE)); |
62 |
} |
70 |
} |
63 |
|
71 |
|
64 |
|
72 |
|