GlueGen: com.jogamp.common.util.CustomCompress Class Reference

GlueGen v2.6.0-rc-20250712 GlueGen, Native Binding Generator for Java™ (public API).

Static Public Member Functions | Static Public Attributes | List of all members
com.jogamp.common.util.CustomCompress Class Reference

All in memory inflater / deflator for small chunks using streams. More...

Collaboration diagram for com.jogamp.common.util.CustomCompress:

## Static Public Member Functions

static byte[] | inflateFromStream (final InputStream in) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException
static byte[] | inflateFromStream (final InputStream in, final int inLen, final int outLen, final byte[] output, final int outOff) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException
static int | deflateToStream (final byte[] input, final int inOff, final int inLen, final int level, final OutputStream out) throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException

## Static Public Attributes

static final int | MAGIC = 0xDEF1A7E0
| Start of stream header for deflated data. More...

## Detailed Description

All in memory inflater / deflator for small chunks using streams.

Stream header of deflated data:

- 4 bytes magic 0xDEF1A7E0 (Big Endian)
- 4 bytes integer deflated-size (Big Endian)
- 4 bytes integer inflated-size (Big Endian)
- deflated bytes

Definition at line 51 of file CustomCompress.java.

## Member Function Documentation

## ◆ deflateToStream()

static int com.jogamp.common.util.CustomCompress.deflateToStream | ( | final byte[] | input,
|  | final int | inOff,
|  | final int | inLen,
|  | final int | level,
|  | final OutputStream | out
| ) |  | throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException

static

Parameters

  input | raw input bytes
  inOff | offset to `input`
  inLen | number of `input` bytes at `inOff`
  level | compression level 0-9 or `Deflater#DEFAULT_COMPRESSION`
  out | sink for deflated bytes

Returns
  number of deflated bytes written, not including the header.

Exceptions

  IOException | if an I/O or deflation exception occurs
  ArrayIndexOutOfBoundsException | if `inOff` and `inLen` exceeds `input`
  IllegalArgumentException | if `inLen` ≤ 0

Definition at line 143 of file CustomCompress.java.

Here is the caller graph for this function:

## ◆ inflateFromStream() [1/2]

static byte[] com.jogamp.common.util.CustomCompress.inflateFromStream | ( | final InputStream | in | ) | throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException

static

Parameters

  in | `InputStream` at start of stream header, i.e. position `MAGIC`.

Returns
  the inflated bytes from the stream

Exceptions

  IOException | if an I/O or deflation exception occurs
  IllegalArgumentException | if `inLen` ≤ 0 or `outLen` ≤ 0, as read from header

Definition at line 62 of file CustomCompress.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ inflateFromStream() [2/2]

static byte[] com.jogamp.common.util.CustomCompress.inflateFromStream | ( | final InputStream | in,
|  | final int | inLen,
|  | final int | outLen,
|  | final byte[] | output,
|  | final int | outOff
| ) |  | throws IOException, ArrayIndexOutOfBoundsException, IllegalArgumentException

static

Parameters

  in | `InputStream` at start of deflated bytes, i.e. after the stream header.
  inLen | number of deflated bytes in stream `in`
  outLen | number of inflated `output` bytes at `outOff`
  output | sink for deflated bytes
  outOff | offset to `output`

Returns
  the inflated bytes from the stream, passing `output` for chaining

Exceptions

  IOException | if an I/O or deflation exception occurs
  ArrayIndexOutOfBoundsException | if `outOff` and `outLen` exceeds `output`
  IllegalArgumentException | if `inLen` ≤ 0 or `outLen` ≤ 0

Definition at line 91 of file CustomCompress.java.

## Member Data Documentation

## ◆ MAGIC

final int com.jogamp.common.util.CustomCompress.MAGIC = 0xDEF1A7E0

static

Start of stream header for deflated data.

Definition at line 53 of file CustomCompress.java.

The documentation for this class was generated from the following file:

- src/java/com/jogamp/common/util/CustomCompress.java