# Module: packet/compressed

## packet/compressed

#### new require("packet/compressed")()

  Source:
    - packet/compressed.js, line 34

Source:
  - packet/compressed.js, line 18

### Members

#### algorithm :compression

  ##### Type:

  - compression
  Source:
    - packet/compressed.js, line 38

#### packets :module:packet/packetlist

  ##### Type:

  - module:packet/packetlist
  Source:
    - packet/compressed.js, line 36

### Methods

#### compress(type, data) → {String}

  Compress the packet data (member decompressedData)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `type` | Integer | Algorithm to be used // See RFC 4880 9.3
  `data` | String | Data to be compressed

  Source:
    - packet/compressed.js, line 135

  ##### Returns:

  The compressed data stored in attribute compressedData
  Type
    String

#### decompress() → {String}

  Decompression method for decompressing the compressed data read by read_packet
  Source:
    - packet/compressed.js, line 76

  ##### Returns:

  The decompressed data
  Type
    String

#### read(input, position, len) → {module:packet/compressed}

  Parsing function for the packet.

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `input` | String | Payload of a tag 8 packet
  `position` | Integer | Position to start reading from the input string
  `len` | Integer | length of the packet or the remaining length of input at position

  Source:
    - packet/compressed.js, line 51

  ##### Returns:

  Object representation
  Type
    module:packet/compressed