Best code examples for Java 8 PrintStream class (java.io.PrintStream)

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 PrintStream class.
You can now enable Codota on your own code to easily search and navigate your Java codebase.

Java 8 PrintStream examples from Open Source projects
This code example shows how to use the following methods: flush, println
        final PrintStream out = new TelnetPrintStream(sockOut);
 
        assertEmptyLine(in);
        assertEquals("type 'help' for a list of commands", in.readLine());
 
        out.println("set a b");
        out.flush();
        assertReply("set a to b", in.readLine());
        assertEmptyLine(in);
 
        out.println("get a");
        out.flush();
        assertReply("b", in.readLine());
        assertEmptyLine(in);
 
        out.println("list");
        out.flush();
        assertReply("a = b", in.readLine());
        assertEmptyLine(in);
    } 

9
CodeRank
This code example shows how to use the following methods: print
  private void printBeginEnvelope(String tag) {
    if (!compoundStack.empty()) {
      String s = compoundStack.peek();
      if ("struct".equals(s)) {
        putIndent(); 
        stream.print("<member>\n");
        addIndent(); 
        putIndent(); 
        stream.print("<name>"+tag+"</name>\n");
        putIndent(); 
        stream.print("<value>");
      } else if ("vector".equals(s)) {
        stream.print("<value>");
      } else if ("map".equals(s)) {
        stream.print("<value>");
      } 
    } else { 
      stream.print("<value>");
    } 
  } 

8
CodeRank
This code example shows how to use the following methods:
  public ProfileOutput(PrintStream out) {
    this.stream = out;
  } 
 
  public ProfileOutput(File out) throws FileNotFoundException {
    this.stream = new PrintStream(new FileOutputStream(out));
  } 
 
  public void printProfile(ProfilePrinter printer) {
    if (headerPrinted) {
      printer.printProfile(stream, false);
    } else { 
      printer.printHeader(stream);
      printer.printProfile(stream, true);
      headerPrinted = true;
      footerAndCleanupOnShutdown(printer);
    } 
  } 
 
  private void footerAndCleanupOnShutdown(final ProfilePrinter printer) {
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods:
    private StandardErrorLogger logger;
    private PrintStream stream;
 
    public void setUp() { 
        baos = new ByteArrayOutputStream();
        stream = new PrintStream(baos);
        logger = new StandardErrorLogger("test", stream);
    } 
 
    public void tearDown() throws IOException { 
        baos.reset();
        baos.close();
    } 
 
    public void testWithDebuggingDisabled() { 
        logger.setDebugEnable(false);
        logger.debug("test");
        stream.flush();
        Assert.assertEquals("", baos.toString());
    } 
Full Snippet Info
8
CodeRank
This code example shows how to use the following methods: printf, println
  public static int run(Tool tool, String[] args) throws Exception {
    return run(tool.getConf(), tool, args);
  } 
 
  public static void printMrsstableCommandUsage(PrintStream out) {
    out.printf("Usage: %s [options] <input dirs> <output dir>\n", MrsstableRunner.class.getSimpleName());
    out.println("options supported are (overload the param of configuration file, which is specified with -conf) : ");
    out.println("-table_id <table id>           overload mrsstable.table.id");
    out.println("-rowkey_desc <rowkey desc>     overload mrsstable.rowkey.desc");
    out.println("-sampler <sampler type>        overload mrsstable.presort.sampler");
    out.println("-delim <delim>                 overload mrsstable.primary.delimeter");
    out.println("-null_flag <null_flag>         overload mrsstable.primary.nullflag");
 
    GenericOptionsParser.printGenericCommandUsage(out);
  } 
 
  public static void main(String[] args) throws Exception {
    int res = MrsstableRunner.run(new Configuration(), new MRGenSstable(), args);
    System.exit(res);
  } 
Full Snippet Info
8
CodeRank
Related Java 8 PrintStream Questions & Answers:
See Code Examples for Java 8 PrintStream Methods: