public interface Compression
Modifier and Type | Method and Description |
---|---|
default boolean |
available()
Indicates whether compression/decompression is available.
|
default byte[] |
compress(byte[] bytes)
Compresses a byte array.
|
default void |
compress(@NotNull BytesIn<?> from,
@NotNull BytesOut<?> to)
Compresses data from the input to the output using the implementing compression algorithm.
|
static void |
compress(@NotNull CharSequence cs,
@NotNull Bytes<?> uncompressed,
@NotNull Bytes<?> compressed)
Compresses the input uncompressed data into the output compressed data using the specified algorithm.
|
OutputStream |
compressingStream(OutputStream output)
Returns an OutputStream that will compress data written to it.
|
InputStream |
decompressingStream(InputStream input)
Returns an InputStream that will decompress data read from it.
|
default byte[] |
uncompress(byte[] bytes)
Uncompresses a byte array.
|
default void |
uncompress(@NotNull BytesIn<?> from,
@NotNull BytesOut<?> to)
Uncompresses data from the input to the output using the implementing uncompression algorithm.
|
static void |
uncompress(@NotNull CharSequence cs,
@NotNull BytesIn<?> from,
@NotNull BytesOut<?> to)
Uncompresses the input compressed data into the output uncompressed data using the specified algorithm.
|
static <T> byte[] |
uncompress(@NotNull CharSequence cs,
T t,
@NotNull net.openhft.chronicle.core.util.ThrowingFunction<T,byte[],net.openhft.chronicle.core.io.IORuntimeException> bytes)
Uncompresses data using the specified algorithm and a custom function to read bytes.
|
static void compress(@NotNull @NotNull CharSequence cs, @NotNull @NotNull Bytes<?> uncompressed, @NotNull @NotNull Bytes<?> compressed) throws IllegalStateException, BufferOverflowException
cs
- The compression algorithm to be used (e.g. "lzw", "gzip").uncompressed
- The input data to be compressed.compressed
- The output to write the compressed data.BufferOverflowException
- If there is not enough space in the output buffer.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayIllegalStateException
static void uncompress(@NotNull @NotNull CharSequence cs, @NotNull @NotNull BytesIn<?> from, @NotNull @NotNull BytesOut<?> to) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalArgumentException, IllegalStateException, BufferOverflowException
cs
- The compression algorithm to be used (e.g. "lzw", "gzip").from
- The input compressed data.to
- The output to write the uncompressed data.net.openhft.chronicle.core.io.IORuntimeException
- If an I/O error occurs.IllegalArgumentException
- If the algorithm is unsupported.BufferOverflowException
- If there is not enough space in the output buffer.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayIllegalStateException
static <T> byte[] uncompress(@NotNull @NotNull CharSequence cs, T t, @NotNull @NotNull net.openhft.chronicle.core.util.ThrowingFunction<T,byte[],net.openhft.chronicle.core.io.IORuntimeException> bytes) throws net.openhft.chronicle.core.io.IORuntimeException
cs
- The compression algorithm to be used (e.g. "lzw", "gzip").t
- The input data.bytes
- A function to read bytes from the input data.net.openhft.chronicle.core.io.IORuntimeException
- If an I/O error occurs.default byte[] compress(byte[] bytes)
bytes
- The input byte array to compress.default void compress(@NotNull @NotNull BytesIn<?> from, @NotNull @NotNull BytesOut<?> to) throws IllegalStateException, BufferOverflowException
from
- The input data to be compressed.to
- The output to write the compressed data.BufferOverflowException
- If there is not enough space in the output buffer.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayIllegalStateException
default byte[] uncompress(byte[] bytes) throws net.openhft.chronicle.core.io.IORuntimeException
bytes
- The input compressed data as byte array.net.openhft.chronicle.core.io.IORuntimeException
- If an I/O error occurs.default void uncompress(@NotNull @NotNull BytesIn<?> from, @NotNull @NotNull BytesOut<?> to) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException, BufferOverflowException
from
- The input compressed data.to
- The output to write the uncompressed data.net.openhft.chronicle.core.io.IORuntimeException
- If an I/O error occurs.BufferOverflowException
- If there is not enough space in the output buffer.net.openhft.chronicle.core.io.ClosedIllegalStateException
- If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException
- If this resource was accessed by multiple threads in an unsafe wayIllegalStateException
InputStream decompressingStream(InputStream input) throws net.openhft.chronicle.core.io.IORuntimeException
input
- the underlying InputStream to read compressed data from.net.openhft.chronicle.core.io.IORuntimeException
- If an I/O error occurs.OutputStream compressingStream(OutputStream output)
output
- the underlying OutputStream to write compressed data to.default boolean available()
Copyright © 2024. All rights reserved.