Lines Matching defs:file
5 * you may not use this file except in compliance with the License.
45 * Reads single file from arguments and attempts to read it as
46 * either a binary hprof file or a version with a text header.
51 usage("binary hprof file argument expected");
54 File file = new File(args[0]);
55 if (!file.exists()) {
56 usage("file " + file + " does not exist");
60 if (startsWithMagic(file)) {
63 hprofData = readHprof(file);
66 + file + ": " + e.getMessage());
74 hprofData = readSnapshot(file);
77 + file + ": " + e.getMessage());
84 * Probe the start of file to see if it starts with a plausible
88 private static boolean startsWithMagic(File file) {
91 inputStream = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
101 * Read and return an HprofData from a vanilla binary hprof file.
103 private static HprofData readHprof(File file) throws IOException {
106 inputStream = new BufferedInputStream(new FileInputStream(file));
114 * Read a file looking for text header terminated by two newlines,
117 private static HprofData readSnapshot(File file) throws IOException {
120 inputStream = new BufferedInputStream(new FileInputStream(file));
178 System.out.println("usage: HprofBinaryToAscii <binary-hprof-file>");
180 System.out.println("Reads a binary hprof file and print it in ASCII format");