|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.poi.util.ArrayUtil
public class ArrayUtil
Utility classes for dealing with arrays.
| Constructor Summary | |
|---|---|
ArrayUtil()
|
|
| Method Summary | |
|---|---|
static void |
arraycopy(byte[] src,
int src_position,
byte[] dst,
int dst_position,
int length)
This is really a debugging version of System.arraycopy(). |
static void |
arrayMoveWithin(java.lang.Object[] array,
int moveFrom,
int moveTo,
int numToMove)
Moves a number of entries in an array to another point in the array, shifting those inbetween as required. |
static byte[] |
copyOf(byte[] source,
int newLength)
Copies the specified array, truncating or padding with zeros (if necessary) so the copy has the specified length. |
static byte[] |
copyOfRange(byte[] original,
int from,
int to)
Copies the specified range of the specified array into a new array. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ArrayUtil()
| Method Detail |
|---|
public static void arraycopy(byte[] src,
int src_position,
byte[] dst,
int dst_position,
int length)
System.arraycopy().
Use it to provide better exception messages when copying arrays around.
For production use it's better to use the original for speed.
public static void arrayMoveWithin(java.lang.Object[] array,
int moveFrom,
int moveTo,
int numToMove)
array - The array to altermoveFrom - The (0 based) index of the first entry to movemoveTo - The (0 based) index of the positition to move tonumToMove - The number of entries to move
public static byte[] copyOf(byte[] source,
int newLength)
source - the array to be copiednewLength - the length of the copy to be returned
java.lang.NegativeArraySizeException - if newLength is negative
java.lang.NullPointerException - if original is null
public static byte[] copyOfRange(byte[] original,
int from,
int to)
original - the array from which a range is to be copiedfrom - the initial index of the range to be copied, inclusiveto - the final index of the range to be copied, exclusive.
(This index may lie outside the array.)
java.lang.ArrayIndexOutOfBoundsException - if from < 0
or from > original.length()
java.lang.IllegalArgumentException - if from > to
java.lang.NullPointerException - if original is null
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||