### Hierarchy

- CompressionUtils

## Index

### Methods

- decompressBuffer
- decompressError
- decompressStream
- newLinesTransform
- zlibTransform

## Methods

### Static decompressBuffer

- decompressBuffer(data: Buffer, encoding: ContentEncoding): Buffer

- - Defined in @zowe/imperative/src/rest/src/client/CompressionUtils.ts:25

  Decompress a buffer using the specified algorithm.

  throws

    {ImperativeError}

  #### Parameters

  - ##### data: Buffer

    Compressed buffer

  - ##### encoding: ContentEncoding

    Value of Content-Encoding header

  #### Returns Buffer

### Static Private decompressError

- decompressError(err: Error, source: "buffer" | "stream", encoding: ContentEncoding): ImperativeError

- - Defined in @zowe/imperative/src/rest/src/client/CompressionUtils.ts:90

  Return ImperativeError populated with details of decompression error

  #### Parameters

  - ##### err: Error

    Thrown error object

  - ##### source: "buffer" | "stream"

    Type of object being decompressed

  - ##### encoding: ContentEncoding

    Value of Content-Encoding header

  #### Returns ImperativeError

### Static decompressStream

- decompressStream(responseStream: Writable, encoding: ContentEncoding, normalizeNewLines?: boolean): Writable

- - Defined in @zowe/imperative/src/rest/src/client/CompressionUtils.ts:54

  Add zlib decompression transform to a Writable stream. Any compressed data written to the returned stream will be decompressed using the specified algorithm.

  The returned stream should only be used internally by a REST client to write to. Use the original stream to read back the decompressed output and handle decompression errors.

  throws

    {ImperativeError}

  #### Parameters

  - ##### responseStream: Writable

    Writable stream that will receive compressed data

  - ##### encoding: ContentEncoding

    Value of Content-Encoding header

  - ##### Optional normalizeNewLines: boolean

    Specifies if line endings should be converted

  #### Returns Writable

### Static Private newLinesTransform

- newLinesTransform(): Transform

- - Defined in @zowe/imperative/src/rest/src/client/CompressionUtils.ts:101

  Return a transform to normalize line endings in response text.

  #### Returns Transform

### Static Private zlibTransform

- zlibTransform(encoding: ContentEncoding, binary: boolean): Transform

- - Defined in @zowe/imperative/src/rest/src/client/CompressionUtils.ts:116

  Return zlib transform for the specified decompression algorithm.

  #### Parameters

  - ##### encoding: ContentEncoding

    Value of Content-Encoding header

  - ##### binary: boolean

  #### Returns Transform

Generated using TypeDoc