forked from I2P_Developers/i2p.i2p
Util: Drop class deprecated 11 years ago
This commit is contained in:
@ -1,29 +0,0 @@
|
||||
package net.i2p.util;
|
||||
|
||||
import java.io.ByteArrayOutputStream;
|
||||
|
||||
import net.i2p.data.ByteArray;
|
||||
|
||||
/**
|
||||
* simple extension to the baos to try to use a ByteCache for its
|
||||
* internal buffer. This caching only works when the array size
|
||||
* provided is sufficient for the entire buffer. After doing what
|
||||
* needs to be done (e.g. write(foo); toByteArray();), call releaseBuffer
|
||||
* to put the buffer back into the cache.
|
||||
*
|
||||
* @deprecated unused
|
||||
*/
|
||||
@Deprecated
|
||||
public class CachingByteArrayOutputStream extends ByteArrayOutputStream {
|
||||
private ByteCache _cache;
|
||||
private ByteArray _buf;
|
||||
|
||||
public CachingByteArrayOutputStream(int cacheQuantity, int arraySize) {
|
||||
super(0);
|
||||
_cache = ByteCache.getInstance(cacheQuantity, arraySize);
|
||||
_buf = _cache.acquire();
|
||||
super.buf = _buf.getData();
|
||||
}
|
||||
|
||||
public void releaseBuffer() { _cache.release(_buf); }
|
||||
}
|
Reference in New Issue
Block a user