org.exist.util
Class ByteArrayPool

java.lang.Object
  extended byorg.exist.util.ByteArrayPool

public class ByteArrayPool
extends java.lang.Object

A pool for byte arrays. This pool is primarily used while parsing documents: serializing the DOM nodes generates a lot of small byte chunks. Only byte arrays with length < MAX are kept in the pool. Large arrays are rarely reused.


Field Summary
static int MAX
           
static int POOL_SIZE
           
static java.lang.ThreadLocal pools_
           
 
Constructor Summary
ByteArrayPool()
           
 
Method Summary
static byte[] getByteArray(int size)
           
static void releaseByteArray(byte[] b)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

POOL_SIZE

public static final int POOL_SIZE
See Also:
Constant Field Values

MAX

public static final int MAX
See Also:
Constant Field Values

pools_

public static final java.lang.ThreadLocal pools_
Constructor Detail

ByteArrayPool

public ByteArrayPool()
Method Detail

getByteArray

public static byte[] getByteArray(int size)

releaseByteArray

public static void releaseByteArray(byte[] b)


Copyright (C) Wolfgang Meier. All rights reserved.