# Class: CompressedDataPacket

## CompressedDataPacket(configopt)

Implementation of the Compressed Data Packet (Tag 8)

RFC4880 5.6: The Compressed Data packet contains compressed data. Typically, this packet is found as the contents of an encrypted packet, or following a Signature or One-Pass Signature packet, and contains a literal data packet.

## Constructor

#### new CompressedDataPacket(configopt)

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/compressed_data.js, line 55

### Members

#### algorithm :enums.compression

Compression algorithm

##### Type:

- enums.compression

Source:
  - packet/compressed_data.js, line 65

#### compressed :Uint8Array|ReadableStream.<Uint8Array>

Compressed packet data

##### Type:

- Uint8Array | ReadableStream.<Uint8Array>

Source:
  - packet/compressed_data.js, line 71

#### deflateLevel

zip/zlib compression level, between 1 and 9

Source:
  - packet/compressed_data.js, line 76

#### packets :PacketList

List of packets

##### Type:

- PacketList

Source:
  - packet/compressed_data.js, line 60

### Methods

#### compress()

Compress the packet data (member decompressedData)

Source:
  - packet/compressed_data.js, line 129

#### (async) decompress(configopt)

Decompression method for decompressing the compressed data read by read_packet

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/compressed_data.js, line 116

#### (async) read(bytes, configopt)

Parsing function for the packet.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`bytes` | Uint8Array | ReadableStream.<Uint8Array> |  | Payload of a tag 8 packet
`config` | Object | <optional> | Full configuration, defaults to openpgp.config

Source:
  - packet/compressed_data.js, line 84

#### write() → {Uint8Array|ReadableStream.<Uint8Array>}

Return the compressed packet.

Source:
  - packet/compressed_data.js, line 102

##### Returns:

Binary compressed packet.

Type
  Uint8Array | ReadableStream.<Uint8Array>