freiheit.com technologies gmbh

## com.freiheit.gnupg
Class GnuPGData

    java.lang.Object
      com.freiheit.gnupg.GnuPGPeer
          com.freiheit.gnupg.GnuPGData

    public class GnuPGData

extends GnuPGPeer

Holds the data that you want to work on and stores the results of crypto operations.

Author:
  Stefan Richter, stefan@freiheit.com

Constructor Summary
`protected` `GnuPGData()` Use the factory methods from GnuPGContext to generate GnuPGData-Objects.
`protected` `GnuPGData(byte[] data)` Use the factory methods from GnuPGContext to generate GnuPGData-Objects.
`protected` `GnuPGData(java.lang.String str)` Use the factory methods from GnuPGContext to generate GnuPGData-Objects.

Method Summary
`void` `destroy()` This calls immediately the release method for the datastructure in the underlying gpgme library.
`protected void` `finalize()` Releases underlying datastructures.
`java.lang.String` `toString()` Helper method to print out the data/string from this data object.
`void` `write(java.io.OutputStream out)` Writes the data/string contained in this data object to the given Java OutputStream.

Methods inherited from class com.freiheit.gnupg.GnuPGPeer
`getInternalRepresentation, setInternalRepresentation`

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

Constructor Detail

### GnuPGData

    protected GnuPGData()

  Use the factory methods from GnuPGContext to generate GnuPGData-Objects. Generates an empty data object. Use this, if you want to create a data object to hold a result from a crypto operation.

### GnuPGData

    protected GnuPGData(java.lang.String str)

  Use the factory methods from GnuPGContext to generate GnuPGData-Objects. Generates a new data object containing the given String.

  Parameters:
    `str` - your string

### GnuPGData

    protected GnuPGData(byte[] data)

  Use the factory methods from GnuPGContext to generate GnuPGData-Objects. Generates a new Data-Object containing the given byte array.

  Parameters:
    `data` - your data

Method Detail

### write

    public void write(java.io.OutputStream out)
               throws java.io.IOException

  Writes the data/string contained in this data object to the given Java OutputStream.

  Parameters:
    `out` - OutputStream, where the data/string should be written
  Throws:
    `java.io.IOException`

### toString

    public java.lang.String toString()

  Helper method to print out the data/string from this data object.

  Overrides:
    `toString` in class `java.lang.Object`
  Returns:
    String representation of the data contained in this data object (expect weired results with binary data)

### destroy

    public void destroy()

  This calls immediately the release method for the datastructure in the underlying gpgme library. This method is called by the finalizer of the class anyway, but you can call it yourself if you want to get rid of this datastructure at once and don't want to wait for the non-deterministic garbage-collector of the JVM.

### finalize

    protected void finalize()

  Releases underlying datastructures. Simple calls the destroy() method.

  Overrides:
    `finalize` in class `java.lang.Object`

freiheit.com technologies gmbh

© 2005 freiheit.com technologies gmbh