/** * Factory method for constructing encoder that is always passed buffer * externally, so that it will not (nor need) allocate encoding buffer. */ public static ChunkEncoder optimalNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeNonAllocatingInstance(totalLength, bufferRecycler); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables * @param bufferRecycler The BufferRecycler instance */ public static ChunkEncoder optimalInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeInstance(totalLength, bufferRecycler); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables * @param bufferRecycler The BufferRecycler instance */ public static ChunkEncoder optimalInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeInstance(totalLength, 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 optimalNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeNonAllocatingInstance(totalLength, bufferRecycler); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * <p/>Uses a ThreadLocal soft-referenced BufferRecycler instance. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables */ public static ChunkEncoder optimalInstance(int totalLength) { try { return UnsafeChunkEncoders.createEncoder(totalLength); } catch (Exception e) { return safeInstance(totalLength); } }
/** * Factory method for constructing encoder that is always passed buffer * externally, so that it will not (nor need) allocate encoding buffer. */ public static ChunkEncoder optimalNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeNonAllocatingInstance(totalLength, bufferRecycler); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * <p/>Uses a ThreadLocal soft-referenced BufferRecycler instance. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables */ public static ChunkEncoder optimalInstance(int totalLength) { try { return UnsafeChunkEncoders.createEncoder(totalLength); } catch (Exception e) { return safeInstance(totalLength); } }
/** * Factory method for constructing encoder that is always passed buffer * externally, so that it will not (nor need) allocate encoding buffer. * <p> * Uses a ThreadLocal soft-referenced BufferRecycler instance. */ public static ChunkEncoder optimalNonAllocatingInstance(int totalLength) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength); } catch (Exception e) { return safeNonAllocatingInstance(totalLength); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables * @param bufferRecycler The BufferRecycler instance */ public static ChunkEncoder optimalInstance(int totalLength, BufferRecycler bufferRecycler) { try { return UnsafeChunkEncoders.createEncoder(totalLength, bufferRecycler); } catch (Exception e) { return safeInstance(totalLength, bufferRecycler); } }
/** * Factory method for constructing encoder that is always passed buffer * externally, so that it will not (nor need) allocate encoding buffer. * <p> * Uses a ThreadLocal soft-referenced BufferRecycler instance. */ public static ChunkEncoder optimalNonAllocatingInstance(int totalLength) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength); } catch (Exception e) { return safeNonAllocatingInstance(totalLength); } }
/** * Method to use for getting compressor instance that uses the most optimal * available methods for underlying data access. It should be safe to call * this method as implementations are dynamically loaded; however, on some * non-standard platforms it may be necessary to either directly load * instances, or use {@link #safeInstance}. * * <p/>Uses a ThreadLocal soft-referenced BufferRecycler instance. * * @param totalLength Expected total length of content to compress; only matters * for content that is smaller than maximum chunk size (64k), to optimize * encoding hash tables */ public static ChunkEncoder optimalInstance(int totalLength) { try { return UnsafeChunkEncoders.createEncoder(totalLength); } catch (Exception e) { return safeInstance(totalLength); } }
/** * Factory method for constructing encoder that is always passed buffer * externally, so that it will not (nor need) allocate encoding buffer. * * <p/>Uses a ThreadLocal soft-referenced BufferRecycler instance. */ public static ChunkEncoder optimalNonAllocatingInstance(int totalLength) { try { return UnsafeChunkEncoders.createNonAllocatingEncoder(totalLength); } catch (Exception e) { return safeNonAllocatingInstance(totalLength); } }