ch.bind.philib.pool.manager
public final class ByteArrayManager extends Object implements ObjectManager<byte[]>
| Constructor and Description |
|---|
ByteArrayManager(int bufferSize) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canReuse(byte[] buf) |
byte[] |
create() |
boolean |
prepareForRecycle(byte[] buf)
Prepare an object to be reused by a different user.
|
void |
release(byte[] buf) |
public byte[] create()
create in interface ObjectManager<byte[]>public boolean prepareForRecycle(byte[] buf)
ObjectManagerprepareForRecycle in interface ObjectManager<byte[]>buf - The object which must be prepared for reuse.true if this object can be reused, false otherwise (for example if the size of the
offered buffer is too small). After returning false destroy(T) will be called.public void release(byte[] buf)
release in interface ObjectManager<byte[]>public boolean canReuse(byte[] buf)
canReuse in interface ObjectManager<byte[]>buf - -true if this pooled object can be reused, false otherwise. Example: The pooled object is
a database connection which might not be reusable because the connection was closed while being in the
pool.Copyright © 2013. All Rights Reserved.