head 1.1; branch 1.1.1; access ; symbols DEVEL:1.1.1.1 HEAD:1.1.1; locks ; strict; comment @# @; 1.1 date 2001.03.16.18.13.13; author jallali; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2001.03.16.18.13.13; author jallali; state Exp; branches ; next ; desc @@ 1.1 log @Initial revision @ text @

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## java.io
Class PrintStream

    java.lang.Object
      |
      +--java.io.OutputStream
            |
            +--java.io.FilterOutputStream
                  |
                  +--java.io.PrintStream

public class PrintStream
extends FilterOutputStream

PrintStream is a class which takes an OutputStream and provides convenience methods for printing common data types in a human readable format on the stream. This is not to be confused with DataOutputStream which is used for encoding common datatypes so that they can be read back in. No IOExceptions are thrown by this class. Instead, callers should call checkError() to see if a problem has been encountered in this Stream.

Fields inherited from class java.io.FilterOutputStream
`out`

Constructor Summary
`PrintStream(OutputStream out)` Constructs a new PrintStream on the OutputStream `out`.
`PrintStream(OutputStream out, boolean autoflush)` Constructs a new PrintStream on the OutputStream `out`.

Method Summary
`boolean` | `checkError()` Answers a boolean indicating whether or not this PrintStream has encountered an error.
`void` | `close()` Close this PrintStream.
`void` | `flush()` Flush this PrintStream to ensure all pending data is sent out to the target OutputStream.
`void` | `print(boolean bool)` Prints the String representation of the `boolean` parameter `bool` to the target OutputStream.
`void` | `print(int inum)` Prints the String representation of the `int` parameter `inum` to the target OutputStream.
`void` | `print(Object obj)` Prints the String representation of the Object parameter `obj` to the target OutputStream.
`void` | `print(String str)` Prints the String representation of the `String` parameter `str` to the target OutputStream.
`void` | `println()` Prints the String representation of the System property `"line.separator"` to the target OutputStream.
`void` | `println(boolean bool)` Prints the String representation of the `boolean` parameter `bool` to the target OutputStream followed by the System property `"line.separator"`.
`void` | `println(int inum)` Prints the String representation of the `int` parameter `inum` to the target OutputStream followed by the System property `"line.separator"`.
`void` | `println(Object obj)` Prints the String representation of the `Object` parameter `obj` to the target OutputStream followed by the System property `"line.separator"`.
`void` | `println(String str)` Prints the String representation of the `String` parameter `str` to the target OutputStream followed by the System property `"line.separator"`.
`protected void` | `setError()`
`void` | `write(byte[] buffer, int offset, int count)` Writes `count` `bytes` from the byte array `buffer` starting at `offset` to this PrintStream.
`void` | `write(int oneByte)` Writes the specified byte `oneByte` to this PrintStream.

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

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

Constructor Detail

### PrintStream

    public PrintStream(OutputStream out)

  Constructs a new PrintStream on the OutputStream `out`. All writes to the target can now take place through this PrintStream. By default, the PrintStream is set to not autoflush when a newline is encountered.
  Parameters:
    `out` - the OutputStream to provide convenience methods on.

### PrintStream

    public PrintStream(OutputStream out,
                       boolean autoflush)

  Constructs a new PrintStream on the OutputStream `out`. All writes to the target can now take place through this PrintStream. The PrintStream is set to not autoflush if `autoflush` is `true`.
  Parameters:
    `out` - the OutputStream to provide convenience methods on.
    `autoflush` - indicates whether or not to flush contents upon encountering a newline sequence.

Method Detail

### checkError

    public boolean checkError()

  Answers a boolean indicating whether or not this PrintStream has encountered an error. If so, the receiver should probably be closed since futher writes will not actually take place. A side effect of calling checkError is that the target OutputStream is flushed.
  Returns:
    `true` if an error occurred in this PrintStream, `false` otherwise.

### close

    public void close()

  Close this PrintStream. This implementation flushes and then closes the target stream. If an error occurs, set an error in this PrintStream to `true`.
  Overrides:
    close in class FilterOutputStream
  Tags copied from class: FilterOutputStream
  Throws:
    IOException - If an error occurs attempting to close this stream.

### flush

    public void flush()

  Flush this PrintStream to ensure all pending data is sent out to the target OutputStream. This implementation flushes the target OutputStream. If an error occurs, set an error in this PrintStream to `true`.
  Overrides:
    flush in class FilterOutputStream
  Tags copied from class: FilterOutputStream
  Throws:
    IOException - If an error occurs attempting to flush this FilterOutputStream.

### print

    public void print(int inum)

  Prints the String representation of the `int` parameter `inum` to the target OutputStream.
  Parameters:
    `inum` - the `int` to print on this PrintStream.

### print

    public void print(Object obj)

  Prints the String representation of the Object parameter `obj` to the target OutputStream.
  Parameters:
    `obj` - the Object to print on this PrintStream.

### print

    public void print(String str)

  Prints the String representation of the `String` parameter `str` to the target OutputStream.
  Parameters:
    `str` - the `String` to print on this PrintStream.

### print

    public void print(boolean bool)

  Prints the String representation of the `boolean` parameter `bool` to the target OutputStream.
  Parameters:
    `bool` - the `boolean` to print on this PrintStream.

### println

    public void println()

  Prints the String representation of the System property `"line.separator"` to the target OutputStream.

### println

    public void println(int inum)

  Prints the String representation of the `int` parameter `inum` to the target OutputStream followed by the System property `"line.separator"`.
  Parameters:
    `inum` - the int to print on this PrintStream.

### println

    public void println(Object obj)

  Prints the String representation of the `Object` parameter `obj` to the target OutputStream followed by the System property `"line.separator"`.
  Parameters:
    `obj` - the `Object` to print on this PrintStream.

### println

    public void println(String str)

  Prints the String representation of the `String` parameter `str` to the target OutputStream followed by the System property `"line.separator"`.
  Parameters:
    `str` - the `String` to print on this PrintStream.

### println

    public void println(boolean bool)

  Prints the String representation of the `boolean` parameter `bool` to the target OutputStream followed by the System property `"line.separator"`.
  Parameters:
    `bool` - the boolean to print on this PrintStream.

### setError

    protected void setError()

### write

    public void write(byte[] buffer,
                      int offset,
                      int count)

  Writes `count` `bytes` from the byte array `buffer` starting at `offset` to this PrintStream. This implementation writes the `buffer` to the target OutputStream and if this PrintStream is set to autoflush, flushes it. If an error occurs, set an error in this PrintStream to `true`.
  Overrides:
    write in class FilterOutputStream
  Parameters:
    `buffer` - the buffer to be written
    `offset` - offset in buffer to get bytes
    `count` - number of bytes in buffer to write
  Throws:
    java.lang.ArrayIndexOutOfBoundsException - If offset or count are outside of bounds.

### write

    public void write(int oneByte)

  Writes the specified byte `oneByte` to this PrintStream. Only the low order byte of `oneByte` is written. This implementation writes `oneByte` to the target OutputStream. If `oneByte` is equal to the character `'\n'` and this PrintSteam is set to autoflush, the target OutputStream is flushed.
  Overrides:
    write in class FilterOutputStream
  Parameters:
    `oneByte` - the byte to be written
  Throws:
    IOException - If an error occurs attempting to write to this FilterOutputStream.

Overview | Package | Class | Tree | Deprecated | Index | Help
| EJCL Xtreme for PalmOS
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

@ 1.1.1.1 log @import initial @ text @@