GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java™ (public API).
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
inputraw input bytes
inOffoffset to input
inLennumber of input bytes at inOff
levelcompression level 0-9 or Deflater#DEFAULT_COMPRESSION
outsink for deflated bytes
Returns
number of deflated bytes written, not including the header.
Exceptions
IOExceptionif an I/O or deflation exception occurs
ArrayIndexOutOfBoundsExceptionif inOff and inLen exceeds input
IllegalArgumentExceptionif 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
inInputStream at start of stream header, i.e. position MAGIC.
Returns
the inflated bytes from the stream
Exceptions
IOExceptionif an I/O or deflation exception occurs
IllegalArgumentExceptionif 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
inInputStream at start of deflated bytes, i.e. after the stream header.
inLennumber of deflated bytes in stream in
outLennumber of inflated output bytes at outOff
outputsink for deflated bytes
outOffoffset to output
Returns
the inflated bytes from the stream, passing output for chaining
Exceptions
IOExceptionif an I/O or deflation exception occurs
ArrayIndexOutOfBoundsExceptionif outOff and outLen exceeds output
IllegalArgumentExceptionif 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: