public class ExternalizeUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static <T> T[] |
readArray(ObjectInput in,
Class<T> type)
Reads an array of String that was written to the output by this utility class
|
static <T extends Enum<T>> |
readEnum(ObjectInput in,
Class<T> clazz,
T defaultVal) |
static List<?> |
readList(ObjectInput in) |
static <T> List<T> |
readList(ObjectInput in,
Class<T> type)
Reads a List that was written by this utility class.
|
static <K,V> Map<K,V> |
readMap(ObjectInput in)
Reads a Map that was written by this utility class
|
static String[] |
readStringArray(ObjectInput in) |
static void |
writeArray(ObjectOutput out,
Object[] array)
Writes an array to the output.
|
static void |
writeCollection(ObjectOutput out,
Collection<?> coll)
Writes a Collection to the output using its Iterator.
|
static void |
writeEnum(ObjectOutput out,
Enum<?> value) |
static void |
writeList(ObjectOutput out,
List<?> coll) |
static void |
writeMap(ObjectOutput out,
Map<?,?> map)
Writes the key-value pairs of the given map to the output.
|
public static void writeArray(ObjectOutput out, Object[] array) throws IOException
out - the output instancearray - reference to an array. Can be null.IOExceptionpublic static void writeCollection(ObjectOutput out, Collection<?> coll) throws IOException
out - the output instancecoll - reference to a Collection. Can be null.IOExceptionpublic static void writeList(ObjectOutput out, List<?> coll) throws IOException
IOExceptionpublic static void writeMap(ObjectOutput out, Map<?,?> map) throws IOException
out - the output instancemap - reference to a Map. Can be null.IOExceptionpublic static <T> T[] readArray(ObjectInput in, Class<T> type) throws IOException, ClassNotFoundException
in - IOExceptionClassNotFoundExceptionpublic static String[] readStringArray(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static <T> List<T> readList(ObjectInput in, Class<T> type) throws IOException, ClassNotFoundException
in - IOExceptionClassNotFoundExceptionpublic static List<?> readList(ObjectInput in) throws IOException, ClassNotFoundException
IOExceptionClassNotFoundExceptionpublic static <K,V> Map<K,V> readMap(ObjectInput in) throws IOException, ClassNotFoundException
in - IOExceptionClassNotFoundExceptionpublic static void writeEnum(ObjectOutput out, Enum<?> value) throws IOException
IOExceptionpublic static <T extends Enum<T>> T readEnum(ObjectInput in, Class<T> clazz, T defaultVal) throws IOException
IOExceptionCopyright © 2020. All rights reserved.