Package java.io

Examples of java.io.PrintWriter.format()


                    } else {
                        writer.format("* %s: OK\n", entry.getKey());
                    }
                } else {
                    if (result.getMessage() != null) {
                        writer.format("! %s: ERROR\n!  %s\n", entry.getKey(), result.getMessage());
                    }

                    @SuppressWarnings("ThrowableResultOfMethodCallIgnored")
                    final Throwable error = result.getError();
                    if (error != null) {
View Full Code Here


        if (!current) {
            rootcount = data.getShort(data.position() + 1) &0xffff;
            length -= (align(3 + rootcount * 3) + refids.length * 16);
        }

        writer.format(
                "Segment %s (%d bytes, %d ref%s, %d root%s)%n",
                uuid, length,
                refids.length, (refids.length != 1 ? "s" : ""),
                rootcount, (rootcount != 1 ? "s" : ""));
        writer.println("--------------------------------------------------------------------------");
View Full Code Here

                refids.length, (refids.length != 1 ? "s" : ""),
                rootcount, (rootcount != 1 ? "s" : ""));
        writer.println("--------------------------------------------------------------------------");
        if (refids.length > 0) {
            for (int i = 0; i < refids.length; i++) {
                writer.format("reference %02x: %s%n", i, refids[i]);
            }
            writer.println("--------------------------------------------------------------------------");
        }
        int pos = data.limit() - ((length + 15) & ~15);
        while (pos < data.limit()) {
View Full Code Here

            }
            writer.println("--------------------------------------------------------------------------");
        }
        int pos = data.limit() - ((length + 15) & ~15);
        while (pos < data.limit()) {
            writer.format("%04x: ", (MAX_SEGMENT_SIZE - data.limit() + pos) >> RECORD_ALIGN_BITS);
            for (int i = 0; i < 16; i++) {
                if (i > 0 && i % 4 == 0) {
                    writer.append(' ');
                }
                if (pos + i >= data.position()) {
View Full Code Here

                if (i > 0 && i % 4 == 0) {
                    writer.append(' ');
                }
                if (pos + i >= data.position()) {
                    byte b = data.get(pos + i);
                    writer.format("%02x ", b & 0xff);
                } else {
                    writer.append("   ");
                }
            }
            writer.append(' ');
View Full Code Here

            final File fsPath = argFspath.getValue();

            // Find the filesystem
            final FileSystem<?> fs = fss.getFileSystem(dev);
            if (fs == null) {
                err.format(fmt_err_nofs, dev.getId());
                exit(1);
            } else {
                // Mount it
                fss.mount(mountPoint.toString(), fs, fsPath.toString());
            }
View Full Code Here

            File file = argFile.getValue();
            if (argFile.isSet()) {
                try {
                    is = new FileInputStream(file);
                } catch (FileNotFoundException ex) {
                    err.format(fmt_cant_open, file, ex.getLocalizedMessage());
                    exit(1);
                }
            } else if (argURL.isSet()) {
                URL url = argURL.getValue();
                try {
View Full Code Here

            } else if (argURL.isSet()) {
                URL url = argURL.getValue();
                try {
                    is = url.openStream();
                } catch (IOException ex) {
                    err.format(fmt_cant_open_url, url, ex.getLocalizedMessage());
                    exit(1);
                }
            } else {
                is = getInput().getInputStream();
                myInput = true;
View Full Code Here

        }
        PrintWriter out = getOutput().getPrintWriter(false);
        PrintWriter err = getError().getPrintWriter();
        for (File path : paths) {
            if (!path.exists()) {
                err.format(fmt_no_path, path);
            } else {
                if (paths.length > 1) {
                    out.println(path + ":");
                }
                if (path.isDirectory()) {
View Full Code Here

        });

        for (ClassDoc cls : classes) {
          // Each class links to Sun's main JavaDoc (brackets indicate wiki
          // link)
          pw.format("[%s%s.html %s]\n", packURL, cls.name(), cls.name());

          // Print out all constructors and methods
          Collection<ExecutableMemberDoc> members = new ArrayList<ExecutableMemberDoc>();
          members.addAll(Arrays.asList(cls.constructors(true)));
          members.addAll(Arrays.asList(cls.methods(true)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.