org.apache.fop.render.ps

## Class DataOutput

- java.lang.Object
- - org.apache.fop.render.ps.DataOutput

-     public class DataOutput
      extends Object

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DataOutput()` Constructor.
    `DataOutput(String encoding)` Constructor with a given encoding.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `byte[]` | `getBytes()` Returns the written data buffer as byte array.
    `void` | `print(String string)` Write the given string to the buffer using the given encoding.
    `void` | `println()` Add a newline to the given string.
    `void` | `println(String string)` Write the given string to the buffer using the given encoding.
    `void` | `write(byte[] buffer)` Write a byte array to the buffer.
    `void` | `write(byte[] buffer, int offset, int length)` Write a part of a byte array to the buffer.
    `void` | `write(int value)` Write an int value to the buffer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### DataOutput

          public DataOutput()

      Constructor.

    - #### DataOutput

          public DataOutput(String encoding)

      Constructor with a given encoding.
      Parameters:
        `encoding` - the encoding to be used for writing

  - ### Method Detail

    - #### getBytes

          public byte[] getBytes()

      Returns the written data buffer as byte array.
      Returns:
        the data buffer as byte array

    - #### write

          public void write(int value)

      Write an int value to the buffer.
      Parameters:
        `value` - the given value

    - #### write

          public void write(byte[] buffer)

      Write a byte array to the buffer.
      Parameters:
        `buffer` - the given byte array

    - #### write

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

      Write a part of a byte array to the buffer.
      Parameters:
        `buffer` - the given byte buffer
        `offset` - the offset where to start
        `length` - the amount of bytes to be written from the array

    - #### print

          public void print(String string)
                     throws IOException

      Write the given string to the buffer using the given encoding.
      Parameters:
        `string` - the given string
      Throws:
        `IOException` - If an error occurs during writing the data to the buffer

    - #### println

          public void println(String string)
                       throws IOException

      Write the given string to the buffer using the given encoding. A newline is added after the given string
      Parameters:
        `string` - the given string
      Throws:
        `IOException` - If an error occurs during writing the data to the buffer

    - #### println

          public void println()

      Add a newline to the given string.

Copyright © 2025 Apache Software Foundation. All rights reserved.