Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.basex.io
Class PrintOutput

    java.lang.Object
      java.io.OutputStream
          org.basex.io.PrintOutput

All Implemented Interfaces:
  Closeable, Flushable

Direct Known Subclasses:
  CachedOutput, NullOutput

    public class PrintOutput

extends OutputStream

This class is a stream-wrapper for textual data. Note that the internal byte representation (usually UTF8) will be directly output without further character conversion.

Author:
  Workgroup DBIS, University of Konstanz 2005-10, ISC License, Christian Gruen

Constructor Summary
`PrintOutput(OutputStream out)` Constructor, given an output stream.
`PrintOutput(String fn)` Constructor, given a filename.

Method Summary
`void` | `close()`
`boolean` | `finished()` Checks if stream can output more characters; can be overwritten to interrupt streaming at some point.
`void` | `flush()`
`void` | `print(byte[] token)` Writes a token to the output stream.
`void` | `print(char ch)` Writes a character to the output stream.
`void` | `print(String str)` Writes a string to the output stream.
`void` | `println()` Writes a newline to the output stream.
`void` | `println(byte[] token)` Writes a token to the output stream.
`void` | `println(String str)` Writes a string and newline to the output stream.
`int` | `size()` Returns the number of written bytes.
`void` | `write(int b)`

Methods inherited from class java.io.OutputStream
`write, write`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### PrintOutput

    public PrintOutput(String fn)
                throws IOException

  Constructor, given a filename.

  Parameters:
    `fn` - filename
  Throws:
    `IOException` - I/O exception

### PrintOutput

    public PrintOutput(OutputStream out)

  Constructor, given an output stream.

  Parameters:
    `out` - output stream reference

Method Detail

### write

    public void write(int b)
               throws IOException

  Specified by:
    `write` in class `OutputStream`
  Throws:
    `IOException`

### print

    public final void print(char ch)
                     throws IOException

  Writes a character to the output stream.

  Parameters:
    `ch` - string to be written
  Throws:
    `IOException` - I/O exception

### print

    public final void print(String str)
                     throws IOException

  Writes a string to the output stream.

  Parameters:
    `str` - string to be written
  Throws:
    `IOException` - I/O exception

### println

    public final void println(String str)
                       throws IOException

  Writes a string and newline to the output stream.

  Parameters:
    `str` - string to be written
  Throws:
    `IOException` - I/O exception

### println

    public final void println()
                       throws IOException

  Writes a newline to the output stream.

  Throws:
    `IOException` - I/O exception

### print

    public final void print(byte[] token)
                     throws IOException

  Writes a token to the output stream.

  Parameters:
    `token` - token to be written
  Throws:
    `IOException` - I/O exception

### println

    public final void println(byte[] token)
                       throws IOException

  Writes a token to the output stream.

  Parameters:
    `token` - token to be written
  Throws:
    `IOException` - I/O exception

### size

    public final int size()

  Returns the number of written bytes.

  Returns:
    number of written bytes

### flush

    public void flush()
               throws IOException

  Specified by:
    `flush` in interface `Flushable`
  Overrides:
    `flush` in class `OutputStream`
  Throws:
    `IOException`

### close

    public void close()
               throws IOException

  Specified by:
    `close` in interface `Closeable`
  Overrides:
    `close` in class `OutputStream`
  Throws:
    `IOException`

### finished

    public boolean finished()

  Checks if stream can output more characters; can be overwritten to interrupt streaming at some point.

  Returns:
    result of check

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD