Overview | Package | Class | Deprecated | Index | Help
| Groovy 1.7.10
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## groovy.io
[Java] Class GroovyPrintStream

    java.lang.Object
      java.io.OutputStream
          java.io.FilterOutputStream
              java.io.PrintStream
                  groovy.io.GroovyPrintStream

    public class GroovyPrintStream
    extends PrintStream

A PrintStream that outputs objects in Groovy style. That means print(Object) uses InvokerHelper.toString(Object) to produce the same results as Writer.print(Object).

Authors:
  Jim White

Since:
  1.6

Constructor Summary
`GroovyPrintStream(OutputStream out)` Creates a new print stream.
`GroovyPrintStream(OutputStream out, boolean autoFlush)` Creates a new print stream.
`GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding)` Creates a new print stream.
`GroovyPrintStream(String fileName)` Creates a new print stream, without automatic line flushing, with the specified file name.
`GroovyPrintStream(String fileName, String csn)` Creates a new print stream, without automatic line flushing, with the specified file name and charset.
`GroovyPrintStream(File file)` Creates a new print stream, without automatic line flushing, with the specified file.
`GroovyPrintStream(File file, String csn)` Creates a new print stream, without automatic line flushing, with the specified file and charset.

Method Summary
`void` | `print(Object obj)` Prints an object Groovy style.
`void` | `println(Object obj)` Prints an object Groovy style followed by a newline.

Methods inherited from class PrintStream
println, println, println, println, println, println, println, println, println, println, append, append, append, append, append, append, format, format, write, write, print, print, print, print, print, print, print, print, print, close, flush, checkError, printf, printf, write, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Methods inherited from class FilterOutputStream
write, write, write, close, flush, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Methods inherited from class OutputStream
write, write, write, close, flush, wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll

Constructor Detail

### GroovyPrintStream

    public GroovyPrintStream(OutputStream out)

  Creates a new print stream. This stream will not flush automatically.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(OutputStream out, boolean autoFlush)

  Creates a new print stream.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(OutputStream out, boolean autoFlush, String encoding)

  Creates a new print stream.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(String fileName)

  Creates a new print stream, without automatic line flushing, with the specified file name.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(String fileName, String csn)

  Creates a new print stream, without automatic line flushing, with the specified file name and charset.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(File file)

  Creates a new print stream, without automatic line flushing, with the specified file.
  See Also:
    PrintStream.PrintStream

### GroovyPrintStream

    public GroovyPrintStream(File file, String csn)

  Creates a new print stream, without automatic line flushing, with the specified file and charset.
  See Also:
    PrintStream.PrintStream

Method Detail

### print

    public void print(Object obj)

  Prints an object Groovy style.
  Parameters:
    `obj` - The `Object` to be printed

### println

    public void println(Object obj)

  Prints an object Groovy style followed by a newline.
  Parameters:
    `obj` - The `Object` to be printed

Copyright © 2003-2010 The Codehaus. All rights reserved.