net.sf.ehcache.store

Class DiskStore.MemoryEfficientByteArrayOutputStream

class DiskStore.MemoryEfficientByteArrayOutputStream extends ByteArrayOutputStream

This class is designed to minimse the number of System.arraycopy(); methods required to complete.
Constructor Summary
MemoryEfficientByteArrayOutputStream(int size)
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.
Method Summary
byte[]getBytes()
Gets the bytes.

Constructor Detail

MemoryEfficientByteArrayOutputStream

public MemoryEfficientByteArrayOutputStream(int size)
Creates a new byte array output stream, with a buffer capacity of the specified size, in bytes.

Parameters: size the initial size.

Method Detail

getBytes

public byte[] getBytes()
Gets the bytes. Not all may be valid. Use only up to getSize()

Returns: the underlying byte[]