org.mortbay.util

Class ByteArrayPool

public class ByteArrayPool extends Object

Byte Array Pool Simple pool for recycling byte arrays of a fixed size.

Version: $Id: ByteArrayPool.java,v 1.9 2004/05/09 20:32:49 gregwilkins Exp $

Author: Greg Wilkins (gregw)

Field Summary
static ThreadLocal__pools
static int__POOL_SIZE
static int__slot
Method Summary
static byte[]getByteArray(int size)
Get a byte array from the pool of known size.
static byte[]getByteArrayAtLeast(int minSize)
static voidreturnByteArray(byte[] b)

Field Detail

__pools

public static final ThreadLocal __pools

__POOL_SIZE

public static final int __POOL_SIZE

__slot

public static int __slot

Method Detail

getByteArray

public static byte[] getByteArray(int size)
Get a byte array from the pool of known size.

Parameters: size Size of the byte array.

Returns: Byte array of known size.

getByteArrayAtLeast

public static byte[] getByteArrayAtLeast(int minSize)

returnByteArray

public static void returnByteArray(byte[] b)
Copyright © 2004 Mortbay Consulting Pty. Ltd. All Rights Reserved.