/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * * @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 safeInstance(int totalLength, BufferRecycler bufferRecycler) { return new VanillaChunkEncoder(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 safeNonAllocatingInstance(int totalLength) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength); }
int seen = first(in, inPos); // past 4 bytes we have seen... (last one is LSB) int literals = 0; inEnd -= TAIL_LENGTH; int off = hash(seen); int ref = hashTable[off]; hashTable[off] = inPos; outPos++; inPos += len; seen = first(in, inPos); seen = (seen << 8) + (in[inPos + 2] & 255); hashTable[hash(seen)] = inPos; ++inPos; seen = (seen << 8) + (in[inPos + 2] & 255); // hash = next(hash, in, inPos); hashTable[hash(seen)] = inPos; ++inPos; return _handleTail(in, inPos, inEnd+4, out, outPos, literals);
int seen = first(in, inPos); // past 4 bytes we have seen... (last one is LSB) int literals = 0; inEnd -= TAIL_LENGTH; int off = hash(seen); int ref = hashTable[off]; hashTable[off] = inPos; outPos++; inPos += len; seen = first(in, inPos); seen = (seen << 8) + (in[inPos + 2] & 255); hashTable[hash(seen)] = inPos; ++inPos; seen = (seen << 8) + (in[inPos + 2] & 255); // hash = next(hash, in, inPos); hashTable[hash(seen)] = inPos; ++inPos; return _handleTail(in, inPos, inEnd+4, out, outPos, literals);
int seen = first(in, inPos); // past 4 bytes we have seen... (last one is LSB) int literals = 0; inEnd -= TAIL_LENGTH; int off = hash(seen); int ref = hashTable[off]; hashTable[off] = inPos; outPos++; inPos += len; seen = first(in, inPos); seen = (seen << 8) + (in[inPos + 2] & 255); hashTable[hash(seen)] = inPos; ++inPos; seen = (seen << 8) + (in[inPos + 2] & 255); // hash = next(hash, in, inPos); hashTable[hash(seen)] = inPos; ++inPos; return _handleTail(in, inPos, inEnd+4, out, outPos, literals);
/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * * @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 safeInstance(int totalLength, BufferRecycler bufferRecycler) { return new VanillaChunkEncoder(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 safeNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength, bufferRecycler); } }
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength, BufferRecycler bufferRecycler) { return new VanillaChunkEncoder(totalLength, bufferRecycler, true); }
/** * 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 safeNonAllocatingInstance(int totalLength) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength); }
/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * * <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 safeInstance(int totalLength) { return new VanillaChunkEncoder(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 safeNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength, bufferRecycler); } }
/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * <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 safeInstance(int totalLength) { return new VanillaChunkEncoder(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 safeNonAllocatingInstance(int totalLength, BufferRecycler bufferRecycler) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength, bufferRecycler); } }
/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * * @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 safeInstance(int totalLength, BufferRecycler bufferRecycler) { return new VanillaChunkEncoder(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 safeNonAllocatingInstance(int totalLength) { return VanillaChunkEncoder.nonAllocatingEncoder(totalLength); }
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength) { return new VanillaChunkEncoder(totalLength, true); }
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength, BufferRecycler bufferRecycler) { return new VanillaChunkEncoder(totalLength, bufferRecycler, true); }
/** * Method that can be used to ensure that a "safe" compressor instance is loaded. * Safe here means that it should work on any and all Java platforms. * <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 safeInstance(int totalLength) { return new VanillaChunkEncoder(totalLength); }
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength) { return new VanillaChunkEncoder(totalLength, true); }
public static VanillaChunkEncoder nonAllocatingEncoder(int totalLength) { return new VanillaChunkEncoder(totalLength, true); }