当前位置: 首页>>代码示例>>Java>>正文


Java PrintStream.append方法代码示例

本文整理汇总了Java中java.io.PrintStream.append方法的典型用法代码示例。如果您正苦于以下问题:Java PrintStream.append方法的具体用法?Java PrintStream.append怎么用?Java PrintStream.append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在java.io.PrintStream的用法示例。


在下文中一共展示了PrintStream.append方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: writeClassHeader

import java.io.PrintStream; //导入方法依赖的package包/类
private void writeClassHeader(DexClass clazz, PrintStream ps) {
  StringBuilder builder = new StringBuilder();
  builder.append(".class ");
  builder.append(clazz.accessFlags.toSmaliString());
  builder.append(" ");
  builder.append(clazz.type.toSmaliString());
  builder.append("\n\n");
  if (clazz.type != dexItemFactory.objectType) {
    builder.append(".super ");
    builder.append(clazz.superType.toSmaliString());
    builder.append("\n");
    for (DexType iface : clazz.interfaces.values) {
      builder.append(".implements ");
      builder.append(iface.toSmaliString());
      builder.append("\n");
    }
  }
  ps.append(builder.toString());
}
 
开发者ID:inferjay,项目名称:r8,代码行数:20,代码来源:DexApplication.java

示例2: saveTextFile

import java.io.PrintStream; //导入方法依赖的package包/类
public static void saveTextFile(String filepath,GeneralMatrixString text)
  {
try
{
	FileOutputStream f = new FileOutputStream(filepath);
	PrintStream p = new PrintStream(f);
	for(int i=0;i<text.height;i++)
	{
		if(text.value[i]==null)
			p.append("\n");
		else
			p.append(text.value[i]+"\n");
	}
	p.close();
}
catch(Exception e)
{
	System.out.println(e.toString());
}
  }
 
开发者ID:johndavidbustard,项目名称:RoughWorld,代码行数:21,代码来源:TextImportExport.java

示例3: toJson

import java.io.PrintStream; //导入方法依赖的package包/类
public void toJson(PrintStream ps, Map<String, String> globalTags) {
  ps.append("{");
  {
    ps.append("\n\"metric\":\"").append(getMetric()).append("\",")
        .append("\n\"timestamp\":").append(Long.toString(getTimestamp())).append(",")
        .append("\n\"value\":").append(String.valueOf(getValue()));
    ps.append(",\n\"tags\": {");

    Map<String, String> tagsToMarshall = new LinkedHashMap<>(getTags());
    if (globalTags != null) {
      tagsToMarshall.putAll(globalTags);
    }
    Iterator<Entry<String, String>> iterator = tagsToMarshall.entrySet().iterator();
    while (iterator.hasNext()) {
      Entry<String, String> tag = iterator.next();
      ps.append("\n\"").append(tag.getKey()).append("\":\"")
          .append(tag.getValue()).append("\"");
      if (iterator.hasNext()) {
        ps.append(",");
      }
    }
    ps.append("}\n");
  }
  ps.append("}");
}
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:26,代码来源:DataPoint.java

示例4: writeClassFooter

import java.io.PrintStream; //导入方法依赖的package包/类
private void writeClassFooter(DexClass clazz, PrintStream ps) {
  StringBuilder builder = new StringBuilder();
  builder.append("# End of class ");
  builder.append(clazz.type.toSmaliString());
  builder.append("\n");
  ps.append(builder.toString());
}
 
开发者ID:inferjay,项目名称:r8,代码行数:8,代码来源:DexApplication.java

示例5: printStackTrace

import java.io.PrintStream; //导入方法依赖的package包/类
@Override
public void printStackTrace(PrintStream err) {
  super.printStackTrace(err);

  int currentIndex = -1;
  for (Throwable throwable : innerThrowables) {
    err.append("\n");
    err.append("  Inner throwable #");
    err.append(Integer.toString(++currentIndex));
    err.append(": ");
    throwable.printStackTrace(err);
    err.append("\n");
  }
}
 
开发者ID:zuoweitan,项目名称:Hitalk,代码行数:15,代码来源:AggregateException.java

示例6: printStackTrace

import java.io.PrintStream; //导入方法依赖的package包/类
public void printStackTrace(PrintStream err) {
    super.printStackTrace(err);
    int currentIndex = -1;
    for (Throwable throwable : this.innerThrowables) {
        err.append("\n");
        err.append("  Inner throwable #");
        currentIndex++;
        err.append(Integer.toString(currentIndex));
        err.append(": ");
        throwable.printStackTrace(err);
        err.append("\n");
    }
}
 
开发者ID:JackChan1999,项目名称:letv,代码行数:14,代码来源:AggregateException.java

示例7: damageSignature

import java.io.PrintStream; //导入方法依赖的package包/类
/**
 * Replace the first equals character in META-INF/T_ALIAS.SF "=" found
 * after text "Digest-Manifest-Main-Attributes" with character "!".
 */
private void damageSignature(File extractDir)
        throws FileNotFoundException, IOException {

    File metaInfFile = new File(extractDir, "META-INF");
    File tAliasSfFile = new File(metaInfFile, "T_ALIAS.SF");
    FileInputStream fis = new FileInputStream(tAliasSfFile);
    StringBuilder sb = new StringBuilder();
    try {
        BufferedInputStream bis = new BufferedInputStream(fis);
        try {
            InputStreamReader isr = new InputStreamReader(bis, "UTF-8");
            try {
                char[] buffer = new char[1024];
                int read;
                while ((read = isr.read(buffer)) != -1) {
                    sb.append(buffer, 0, read);
                }
            } finally {
                isr.close();
            }
        } finally {
            bis.close();
        }
    } finally {
        fis.close();
    }
    int mainAttsStart = sb.indexOf("Digest-Manifest-Main-Attributes");
    int replacePos = sb.indexOf("=", mainAttsStart);
    sb.replace(replacePos, replacePos + 1, "!");
    FileOutputStream fos = new FileOutputStream(tAliasSfFile);
    try {
        BufferedOutputStream bos = new BufferedOutputStream(fos);
        try {
            PrintStream ps = new PrintStream(bos);
            try {
                ps.append(sb);
            } finally {
                ps.close();
            }
        } finally {
            bos.close();
        }
    } finally {
        fos.close();
    }
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:51,代码来源:JarFileSystemHidden.java

示例8: generateRule

import java.io.PrintStream; //导入方法依赖的package包/类
public String generateRule(PrintStream stringBuilder) {

      stringBuilder.append("RULE ");
      stringBuilder.append(ruleName);
      stringBuilder.append(LINEBREAK);

      if (isInterface) {
        stringBuilder.append("INTERFACE ");
      } else {
        stringBuilder.append("CLASS ");
      }
      if (isIncludeSubclases) {
        stringBuilder.append("^");
      }
      stringBuilder.append(className);
      stringBuilder.append(LINEBREAK);

      stringBuilder.append("METHOD ");
      stringBuilder.append(methodName);
      stringBuilder.append(LINEBREAK);

      stringBuilder.append(where);
      stringBuilder.append(LINEBREAK);

      if (helperName != null) {
        stringBuilder.append("HELPER ");
        stringBuilder.append(helperName);
        stringBuilder.append(LINEBREAK);
      }

      if (imports != null) {
        stringBuilder.append(imports);
      }

      if (compile != null) {
        stringBuilder.append(compile);
        stringBuilder.append(LINEBREAK);
      }

      if (bind != null) {
        stringBuilder.append("BIND ");
        stringBuilder.append(bind);
        stringBuilder.append(LINEBREAK);
      }

      stringBuilder.append("IF ");
      stringBuilder.append(ifcondition);
      stringBuilder.append(LINEBREAK);

      stringBuilder.append("DO ");
      stringBuilder.append(action);
      stringBuilder.append(LINEBREAK);

      stringBuilder.append("ENDRULE");
      stringBuilder.append(LINEBREAK);

      return stringBuilder.toString();
    }
 
开发者ID:ApptuitAI,项目名称:JInsight,代码行数:59,代码来源:AbstractRuleSet.java

示例9: write

import java.io.PrintStream; //导入方法依赖的package包/类
public final void write(PrintStream out) throws IOException {
  out.append(sb);
}
 
开发者ID:naver,项目名称:hadoop,代码行数:4,代码来源:ContainerLaunch.java

示例10: append

import java.io.PrintStream; //导入方法依赖的package包/类
@Override
public PrintStream append(char c) {
	
	for (PrintStream out : streams) {
		
		out.append(c);
	}
	
	return this;
}
 
开发者ID:Deconimus,项目名称:JarShrink,代码行数:11,代码来源:MultiPrintStream.java


注:本文中的java.io.PrintStream.append方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。