Compression (dnsjava documentation)
Date: 2013-04-10

org.xbill.DNS

## Class Compression

- java.lang.Object
- - org.xbill.DNS.Compression

-     public class Compression
      extends Object

  DNS Name Compression object.
  Author:
    Brian Wellington
  See Also:
    `Message`, `Name`

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Compression()` Creates a new Compression object.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `add(int pos, Name name)` Adds a compression entry mapping a name to a position in a message.
    `int` | `get(Name name)` Retrieves the position of the given name, if it has been previously included in the message.

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

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

- - ### Constructor Detail

    - #### Compression

          public Compression()

      Creates a new Compression object.

  - ### Method Detail

    - #### add

          public void add(int pos,
                 Name name)

      Adds a compression entry mapping a name to a position in a message.
      Parameters:
        `pos` - The position at which the name is added.
        `name` - The name being added to the message.

    - #### get

          public int get(Name name)

      Retrieves the position of the given name, if it has been previously included in the message.
      Parameters:
        `name` - The name to find in the compression table.
      Returns:
        The position of the name, or -1 if not found.