@Test public void testGet() { for (int i = 0; i < pool.size() + 5; i++) { BufferSupplier.BufferSupply supply = pool.get(); ByteBuffer buffer = supply.acquire(); buffer.put("abcdefg".getBytes()); supply.release(); } }
@Override public BufferSupply get() { BufferPoolSupply supply = queue.poll(); if (null == supply) { supply = newInstance(); } return supply; }
BufferPool implements BufferSupplier { @Override public BufferSupply get() { BufferPoolSupply supply = queue.poll(); if (null == supply) { supply = newInstance(); } return supply; } }
BufferPool implements BufferSupplier { @Override public BufferSupply get() { BufferPoolSupply supply = queue.poll(); if (null == supply) { supply = newInstance(); } return supply; } BufferPool();  BufferPool(int capacity, int poolSize, ByteOrder order); }
BufferPool implements BufferSupplier { @Override public BufferSupply get() { BufferPoolSupply supply = queue.poll(); if (null == supply) { supply = newInstance(); } return supply; } BufferPool();  BufferPool(int capacity, int poolSize, ByteOrder order); @Override BufferSupply get(); int size(); }
BufferPool implements BufferSupplier { @Override public BufferSupply get() { BufferPoolSupply supply = queue.poll(); if (null == supply) { supply = newInstance(); } return supply; } BufferPool();  BufferPool(int capacity, int poolSize, ByteOrder order); @Override BufferSupply get(); int size(); static final int DEFAULT_BUFFER_CAPACITY; static final int DEFAULT_POOL_SIZE; }