本文整理汇总了Java中edu.umd.cs.findbugs.charsets.UTF8.printWriter方法的典型用法代码示例。如果您正苦于以下问题:Java UTF8.printWriter方法的具体用法?Java UTF8.printWriter怎么用?Java UTF8.printWriter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类edu.umd.cs.findbugs.charsets.UTF8
的用法示例。
在下文中一共展示了UTF8.printWriter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import edu.umd.cs.findbugs.charsets.UTF8; //导入方法依赖的package包/类
public static void main(String[] args) throws IOException, DocumentException {
FindBugs.setNoAnalysis();
DetectorFactoryCollection.instance();
ListBugDatabaseInfoCommandLine commandLine = new ListBugDatabaseInfoCommandLine();
int argCount = commandLine.parse(args, 0, Integer.MAX_VALUE, USAGE);
PrintWriter out = UTF8.printWriter(System.out, true);
if (argCount == args.length)
listVersion(out, null, commandLine.formatDates);
else {
out.println("version\ttime\tclasses\tNCSS\terrors\ttotal\thigh\tmedium\tlow\tfile");
while (argCount < args.length) {
String fileName = args[argCount++];
listVersion(out, fileName, commandLine.formatDates);
}
}
out.close();
}
示例2: main
import edu.umd.cs.findbugs.charsets.UTF8; //导入方法依赖的package包/类
public static void main(String[] argv) throws Exception {
FindBugs.setNoAnalysis();
final CSPoptions options = new CSPoptions();
final CSRCommandLine commandLine = new CSRCommandLine(options);
int argCount = commandLine.parse(argv, 0, 1, "Usage: " + CloudSyncAndReport.class.getName()
+ " [options] [<results1> <results2> ... <resultsn>] ");
if (argCount < argv.length)
options.analysisFile = argv[argCount];
CloudSyncAndReport csr = new CloudSyncAndReport(options);
csr.load();
csr.sync();
PrintWriter out = UTF8.printWriter(System.out);
csr.report(out);
out.flush();
csr.shutdown();
out.close();
}
示例3: write
import edu.umd.cs.findbugs.charsets.UTF8; //导入方法依赖的package包/类
/**
* Save the project to an output file.
*
* @param outputFile
* name of output file
* @param useRelativePaths
* true if the project should be written using only relative
* paths
* @param relativeBase
* if useRelativePaths is true, this file is taken as the base
* directory in terms of which all files should be made relative
* @throws IOException
* if an error occurs while writing
*/
@Deprecated
public void write(String outputFile, boolean useRelativePaths, String relativeBase) throws IOException {
PrintWriter writer = UTF8.printWriter(outputFile);
try {
writer.println(JAR_FILES_KEY);
for (String jarFile : analysisTargets) {
if (useRelativePaths) {
jarFile = convertToRelative(jarFile, relativeBase);
}
writer.println(jarFile);
}
writer.println(SRC_DIRS_KEY);
for (String srcDir : srcDirList) {
if (useRelativePaths) {
srcDir = convertToRelative(srcDir, relativeBase);
}
writer.println(srcDir);
}
writer.println(AUX_CLASSPATH_ENTRIES_KEY);
for (String auxClasspathEntry : auxClasspathEntryList) {
if (useRelativePaths) {
auxClasspathEntry = convertToRelative(auxClasspathEntry, relativeBase);
}
writer.println(auxClasspathEntry);
}
if (useRelativePaths) {
writer.println(OPTIONS_KEY);
writer.println(RELATIVE_PATHS + "=true");
}
} finally {
writer.close();
}
// Project successfully saved
isModified = false;
}
示例4: setOutputStream
import edu.umd.cs.findbugs.charsets.UTF8; //导入方法依赖的package包/类
/**
* Set the PrintStream to write bug output to.
*
* @param outputStream
* the PrintStream to write bug output to
*/
public void setOutputStream(PrintStream outputStream) {
this.outputStream = UTF8.printWriter(outputStream, true);
}