public class LZFDecoder extends Object
ChunkDecoder
, although static methods are left here
and may still be used for convenience.
All static methods use ChunkDecoderFactory.optimalInstance()
to find actual ChunkDecoder
instance to use.ChunkDecoder
Modifier and Type | Field and Description |
---|---|
protected static AtomicReference<ChunkDecoder> |
_fastDecoderRef
Lazily initialized "fast" instance that may use
sun.misc.Unsafe
to speed up decompression |
protected static AtomicReference<ChunkDecoder> |
_safeDecoderRef
Lazily initialized "safe" instance that DOES NOT use
sun.misc.Unsafe
for decompression, just standard JDK functionality. |
Constructor and Description |
---|
LZFDecoder() |
Modifier and Type | Method and Description |
---|---|
static int |
calculateUncompressedSize(byte[] data,
int offset,
int length)
Helper method that checks resulting size of an LZF chunk, regardless of
whether it contains compressed or uncompressed contents.
|
static byte[] |
decode(byte[] inputBuffer) |
static int |
decode(byte[] inputBuffer,
byte[] targetBuffer) |
static byte[] |
decode(byte[] inputBuffer,
int offset,
int length) |
static int |
decode(byte[] sourceBuffer,
int offset,
int length,
byte[] targetBuffer) |
static ChunkDecoder |
fastDecoder()
Accessor method that can be used to obtain
ChunkDecoder
that uses all possible optimization methods available, including
sun.misc.Unsafe for memory access. |
static byte[] |
safeDecode(byte[] inputBuffer) |
static int |
safeDecode(byte[] inputBuffer,
byte[] targetBuffer) |
static byte[] |
safeDecode(byte[] inputBuffer,
int offset,
int length) |
static int |
safeDecode(byte[] sourceBuffer,
int offset,
int length,
byte[] targetBuffer) |
static ChunkDecoder |
safeDecoder()
Accessor method that can be used to obtain
ChunkDecoder
that only uses standard JDK access methods, and should work on
all Java platforms and JVMs. |
protected static final AtomicReference<ChunkDecoder> _fastDecoderRef
sun.misc.Unsafe
to speed up decompressionprotected static final AtomicReference<ChunkDecoder> _safeDecoderRef
sun.misc.Unsafe
for decompression, just standard JDK functionality.public static ChunkDecoder fastDecoder()
ChunkDecoder
that uses all possible optimization methods available, including
sun.misc.Unsafe
for memory access.public static ChunkDecoder safeDecoder()
ChunkDecoder
that only uses standard JDK access methods, and should work on
all Java platforms and JVMs.public static int calculateUncompressedSize(byte[] data, int offset, int length) throws LZFException
LZFException
public static byte[] decode(byte[] inputBuffer) throws LZFException
LZFException
public static byte[] decode(byte[] inputBuffer, int offset, int length) throws LZFException
LZFException
public static int decode(byte[] inputBuffer, byte[] targetBuffer) throws LZFException
LZFException
public static int decode(byte[] sourceBuffer, int offset, int length, byte[] targetBuffer) throws LZFException
LZFException
public static byte[] safeDecode(byte[] inputBuffer) throws LZFException
LZFException
public static byte[] safeDecode(byte[] inputBuffer, int offset, int length) throws LZFException
LZFException
public static int safeDecode(byte[] inputBuffer, byte[] targetBuffer) throws LZFException
LZFException
public static int safeDecode(byte[] sourceBuffer, int offset, int length, byte[] targetBuffer) throws LZFException
LZFException
Copyright © 2020 FasterXML. All rights reserved.