Code example for PrintStream

Methods: flush

0
    stream.close();
  } 
 
  @Override 
  public void flush() throws IOException { 
    stream.flush();
  } 
 
  @Override 
  public void write(char[] cbuf, int off, int len) throws IOException {
    if (off == 0 && len == cbuf.length)
      stream.print(cbuf);
    else 
      stream.append(CharBuffer.wrap(cbuf, off, len));
  } 
 
  @Override 
  public void write(String str, int off, int len) throws IOException {
    stream.append(str, off, len);
  }