public class CompressionManager extends Object
For details of all supported algorithms see CompressionAlgorithm.
| Constructor and Description |
|---|
CompressionManager() |
| Modifier and Type | Method and Description |
|---|---|
String |
compress(CompressionAlgorithm compressionAlgorithm,
String data)
Convenience method equivalent to
Base64url.encode(getCompressionHandler(compressionAlgorithm).compress(data.getBytes(Utils.CHARSET))). |
byte[] |
decompress(CompressionAlgorithm compressionAlgorithm,
String data)
Convenience method equivalent to
getCompressionHandler(compressionAlgorithm).decompress(Base64url.decode(data)). |
CompressionHandler |
getCompressionHandler(CompressionAlgorithm algorithm)
Gets the appropriate CompressionHandler that can perform the required compression using the given
compression algorithm.
|
public CompressionHandler getCompressionHandler(CompressionAlgorithm algorithm)
algorithm - The Compression algorithm.public String compress(CompressionAlgorithm compressionAlgorithm, String data)
Base64url.encode(getCompressionHandler(compressionAlgorithm).compress(data.getBytes(Utils.CHARSET))).compressionAlgorithm - the compression algorithm to use.data - the data to compress.public byte[] decompress(CompressionAlgorithm compressionAlgorithm, String data)
getCompressionHandler(compressionAlgorithm).decompress(Base64url.decode(data)).compressionAlgorithm - the compression algorithm to use.data - the base64url-encoded data to decompress.Copyright © 2025 Open Identity Platform Community. All rights reserved.