Lines Matching full:chunk
34 private static final LinkedList<SoftReference<Chunk>> sPool =
35 new LinkedList<SoftReference<Chunk>>();
37 private static final ReferenceQueue<Chunk> sQueue =
38 new ReferenceQueue<Chunk>();
40 private LinkedList<Chunk> mChunks;
43 mChunks = new LinkedList<Chunk>();
48 Chunk c = null;
69 * chunks. This returns the first chunk. Note: this pulls the
70 * chunk out of the queue. The caller must call Chunk.release() to
73 public synchronized Chunk getFirstChunk() {
84 ListIterator<Chunk> it = mChunks.listIterator(0);
86 Chunk c = it.next();
93 Chunk c = getFirstChunk();
103 SoftReference<Chunk> entry = (SoftReference<Chunk>) sQueue.poll();
111 private Chunk obtainChunk(int length) {
120 Chunk c = sPool.removeFirst().get();
127 return new Chunk(length);
131 public static class Chunk {
135 public Chunk(int length) {
141 * Release the chunk and make it available for reuse.
146 // Add the chunk back to the pool as a SoftReference so it can
148 sPool.offer(new SoftReference<Chunk>(this, sQueue));