Top Description Fields Constructors Methods
org.apache.poi.hssf.util

public Class LazilyConcatenatedByteArray

extends Object
Class Inheritance
Imports
java.util.ArrayList, .List

Utility for delaying the concatenation of multiple byte arrays. Doing this up-front causes significantly more copying, which for a large number of byte arrays can cost a large amount of time.

Field Summary

Modifier and TypeField and Description
private final List<byte[]>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Clears the array (sets the concatenated length back to zero.

public void
concatenate(byte[]
the array to concatenate.
array
)

Concatenates an array onto the end of our array.

public void
public byte[]

Returns:

the byte array. Returns null if no data has been placed into it.
toArray
()

Gets the concatenated contents as a single byte array.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

arraysback to summary
private final List<byte[]> arrays

Constructor Detail

LazilyConcatenatedByteArrayback to summary
public LazilyConcatenatedByteArray()

Method Detail

clearback to summary
public void clear()

Clears the array (sets the concatenated length back to zero.

concatenateback to summary
public void concatenate(byte[] array)

Concatenates an array onto the end of our array. This is a relatively fast operation.

Parameters
array:byte[]

the array to concatenate.

Exceptions
IllegalArgumentException:
if array is null.
concatenateback to summary
public void concatenate(LazilyConcatenatedByteArray other)
toArrayback to summary
public byte[] toArray()

Gets the concatenated contents as a single byte array. This is a slower operation, but the concatenated array is stored off as a single array again so that subsequent calls will not perform additional copying.

Returns:byte[]

the byte array. Returns null if no data has been placed into it.