/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler); *</code> */ public static ChunkEncoder safeInstance(BufferRecycler bufferRecycler) { return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler); } /**
/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN); *</code> */ public static ChunkEncoder safeInstance() { return safeInstance(LZFChunk.MAX_CHUNK_LEN); }
/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler); *</code> */ public static ChunkEncoder safeInstance(BufferRecycler bufferRecycler) { return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler); } /**
/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN); *</code> */ public static ChunkEncoder safeInstance() { return safeInstance(LZFChunk.MAX_CHUNK_LEN); }
/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN); *</code> */ public static ChunkEncoder safeInstance() { return safeInstance(LZFChunk.MAX_CHUNK_LEN); }
/** * Convenience method, equivalent to: *<code> * return safeInstance(LZFChunk.MAX_CHUNK_LEN, bufferRecycler); *</code> */ public static ChunkEncoder safeInstance(BufferRecycler bufferRecycler) { return safeInstance(LZFChunk.MAX_CHUNK_LEN, 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}. * * <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); } }
/** * 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); } }
/** * 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); } }
/** * 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); } }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length, BufferRecycler bufferRecycler) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length, bufferRecycler); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length, BufferRecycler bufferRecycler) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length, bufferRecycler); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length, BufferRecycler bufferRecycler) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length, bufferRecycler); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }
/** * Method that will use "safe" {@link ChunkEncoder}, as produced by * {@link ChunkEncoderFactory#safeInstance}, for encoding. Safe here * means that it does not use any non-compliant features beyond core JDK. */ public static byte[] safeEncode(byte[] data, int offset, int length) { ChunkEncoder enc = ChunkEncoderFactory.safeInstance(length); byte[] result = encode(enc, data, offset, length); enc.close(); return result; }