public class ChunkEncoderFactory extends Object
ChunkEncoder
implementations, based on criteria
such as "fastest available" or "safe to run anywhere".Constructor and Description |
---|
ChunkEncoderFactory() |
Modifier and Type | Method and Description |
---|---|
static ChunkEncoder |
optimalInstance()
Convenience method, equivalent to:
return optimalInstance(LZFChunk.MAX_CHUNK_LEN);
|
static ChunkEncoder |
optimalInstance(BufferRecycler bufferRecycler)
Convenience method, equivalent to:
return optimalInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler);
|
static ChunkEncoder |
optimalInstance(int totalLength)
Method to use for getting compressor instance that uses the most optimal
available methods for underlying data access.
|
static ChunkEncoder |
optimalInstance(int totalLength,
BufferRecycler bufferRecycler)
Method to use for getting compressor instance that uses the most optimal
available methods for underlying data access.
|
static ChunkEncoder |
optimalNonAllocatingInstance(int totalLength)
Factory method for constructing encoder that is always passed buffer
externally, so that it will not (nor need) allocate encoding buffer.
|
static ChunkEncoder |
optimalNonAllocatingInstance(int totalLength,
BufferRecycler bufferRecycler)
Factory method for constructing encoder that is always passed buffer
externally, so that it will not (nor need) allocate encoding buffer.
|
static ChunkEncoder |
safeInstance()
Convenience method, equivalent to:
return safeInstance(LZFChunk.MAX_CHUNK_LEN);
|
static ChunkEncoder |
safeInstance(BufferRecycler bufferRecycler)
Convenience method, equivalent to:
return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler);
|
static ChunkEncoder |
safeInstance(int totalLength)
Method that can be used to ensure that a "safe" compressor instance is loaded.
|
static ChunkEncoder |
safeInstance(int totalLength,
BufferRecycler bufferRecycler)
Method that can be used to ensure that a "safe" compressor instance is loaded.
|
static ChunkEncoder |
safeNonAllocatingInstance(int totalLength)
Factory method for constructing encoder that is always passed buffer
externally, so that it will not (nor need) allocate encoding buffer.
|
static ChunkEncoder |
safeNonAllocatingInstance(int totalLength,
BufferRecycler bufferRecycler)
Factory method for constructing encoder that is always passed buffer
externally, so that it will not (nor need) allocate encoding buffer.
|
public static ChunkEncoder optimalInstance()
return optimalInstance(LZFChunk.MAX_CHUNK_LEN);
public static ChunkEncoder optimalInstance(int totalLength)
safeInstance()
.
Uses a ThreadLocal soft-referenced BufferRecycler instance.totalLength
- Expected total length of content to compress; only matters
for content that is smaller than maximum chunk size (64k), to optimize
encoding hash tablespublic static ChunkEncoder optimalNonAllocatingInstance(int totalLength)
Uses a ThreadLocal soft-referenced BufferRecycler instance.
public static ChunkEncoder safeInstance()
return safeInstance(LZFChunk.MAX_CHUNK_LEN);
public static ChunkEncoder safeInstance(int totalLength)
Uses a ThreadLocal soft-referenced BufferRecycler instance.
totalLength
- Expected total length of content to compress; only matters
for content that is smaller than maximum chunk size (64k), to optimize
encoding hash tablespublic static ChunkEncoder safeNonAllocatingInstance(int totalLength)
Uses a ThreadLocal soft-referenced BufferRecycler instance.
public static ChunkEncoder optimalInstance(BufferRecycler bufferRecycler)
return optimalInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler);
public static ChunkEncoder optimalInstance(int totalLength, BufferRecycler bufferRecycler)
safeInstance()
.totalLength
- Expected total length of content to compress; only matters
for content that is smaller than maximum chunk size (64k), to optimize
encoding hash tablesbufferRecycler
- The BufferRecycler instancepublic static ChunkEncoder optimalNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler)
public static ChunkEncoder safeInstance(BufferRecycler bufferRecycler)
return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler);
public static ChunkEncoder safeInstance(int totalLength, BufferRecycler bufferRecycler)
totalLength
- Expected total length of content to compress; only matters
for content that is smaller than maximum chunk size (64k), to optimize
encoding hash tablesbufferRecycler
- The BufferRecycler instancepublic static ChunkEncoder safeNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler)
Copyright © 2020 FasterXML. All rights reserved.