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.IOException
public static void writeCollection(ObjectOutput out, Collection<?> coll) throws IOException
out
- the output instancecoll
- reference to a Collection. Can be null.IOException
public static void writeList(ObjectOutput out, List<?> coll) throws IOException
IOException
public static void writeMap(ObjectOutput out, Map<?,?> map) throws IOException
out
- the output instancemap
- reference to a Map. Can be null.IOException
public static <T> T[] readArray(ObjectInput in, Class<T> type) throws IOException, ClassNotFoundException
in
- IOException
ClassNotFoundException
public static String[] readStringArray(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <T> List<T> readList(ObjectInput in, Class<T> type) throws IOException, ClassNotFoundException
in
- IOException
ClassNotFoundException
public static List<?> readList(ObjectInput in) throws IOException, ClassNotFoundException
IOException
ClassNotFoundException
public static <K,V> Map<K,V> readMap(ObjectInput in) throws IOException, ClassNotFoundException
in
- IOException
ClassNotFoundException
public static void writeEnum(ObjectOutput out, Enum<?> value) throws IOException
IOException
public static <T extends Enum<T>> T readEnum(ObjectInput in, Class<T> clazz, T defaultVal) throws IOException
IOException
Copyright © 2020. All rights reserved.