public final class AWUtil extends Object
It is generally preferable to use the static methods this class offers than using ArrayWritable.writeToArray(int, Object[], int, int) directly.
| Modifier and Type | Method and Description |
|---|---|
static <T,U extends T> |
safeWrite(ArrayWritable<U> aw,
T[] array)
Writes the complete container data to an array.
|
static <T,U extends T> |
safeWrite(ArrayWritable<U> aw,
T[] array,
int tgtOfs) |
static <T,U extends T> |
safeWrite(int num,
ArrayWritable<U> aw,
int ofs,
T[] array,
int tgtOfs) |
static <T,U extends T> |
safeWrite(int num,
ArrayWritable<U> aw,
T[] array)
Writes a given maximum amount of data items from a container to an array.
|
static Object[] |
toArray(ArrayWritable<?> aw) |
static <T> T[] |
toArray(ArrayWritable<?> aw,
T[] arr) |
public static <T,U extends T> int safeWrite(ArrayWritable<U> aw, T[] array)
aw - the container.array - the arraypublic static <T,U extends T> int safeWrite(int num,
ArrayWritable<U> aw,
T[] array)
num - the number of elements to copyaw - the container.array - the arraypublic static <T,U extends T> int safeWrite(int num,
ArrayWritable<U> aw,
int ofs,
T[] array,
int tgtOfs)
public static <T,U extends T> int safeWrite(ArrayWritable<U> aw, T[] array, int tgtOfs)
public static Object[] toArray(ArrayWritable<?> aw)
public static <T> T[] toArray(ArrayWritable<?> aw, T[] arr)
Copyright © 2018. All rights reserved.