com.ning.compress.lzf
Class BufferRecycler
java.lang.Object
com.ning.compress.lzf.BufferRecycler
public class BufferRecycler
- extends Object
Simple helper class to encapsulate details of basic buffer
recycling scheme, which helps a lot (as per profiling) for
smaller encoding cases.
- Author:
- tatu
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
_recyclerRef
protected static final ThreadLocal<SoftReference<BufferRecycler>> _recyclerRef
- This
ThreadLocal
contains a SoftRerefence
to a BufferRecycler
used to provide a low-cost
buffer recycling for buffers we need for encoding, decoding.
BufferRecycler
public BufferRecycler()
instance
public static BufferRecycler instance()
- Accessor to get thread-local recycler instance
allocEncodingBuffer
public byte[] allocEncodingBuffer(int minSize)
releaseEncodeBuffer
public void releaseEncodeBuffer(byte[] buffer)
allocOutputBuffer
public byte[] allocOutputBuffer(int minSize)
releaseOutputBuffer
public void releaseOutputBuffer(byte[] buffer)
allocEncodingHash
public int[] allocEncodingHash(int suggestedSize)
releaseEncodingHash
public void releaseEncodingHash(int[] buffer)
allocInputBuffer
public byte[] allocInputBuffer(int minSize)
releaseInputBuffer
public void releaseInputBuffer(byte[] buffer)
allocDecodeBuffer
public byte[] allocDecodeBuffer(int size)
releaseDecodeBuffer
public void releaseDecodeBuffer(byte[] buffer)
Copyright © 2011. All Rights Reserved.