public class Serializables extends Object
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logio
The logger called org.zkoss.io.serializable used to log serialization
information.
|
| Modifier and Type | Method and Description |
|---|---|
static <T> Collection<T> |
smartRead(ObjectInputStream s,
Collection<T> col)
Reads serializable elements back (serialized by
smartWrite(ObjectOutputStream,Collection)) |
static <T> List<T> |
smartRead(ObjectInputStream s,
List<T> col)
Reads serializable elements back (serialized by
smartWrite(ObjectOutputStream,Collection)) |
static <K,V> Map<K,V> |
smartRead(ObjectInputStream s,
Map<K,V> map)
Reads serializable entries back (serialized by
smartWrite(ObjectOutputStream,Map)). |
static <T> void |
smartWrite(ObjectOutputStream s,
Collection<T> col)
Writes only serializable elements of the specified collection.
|
static <K,V> void |
smartWrite(ObjectOutputStream s,
Map<K,V> map)
Writes only serializable entries of the specified map.
|
static void |
smartWrite(ObjectOutputStream s,
Object val)
Writes the given value only if it is serializable.
|
static <T> void |
smartWrite(ObjectOutputStream s,
T[] ary)
Writes only serializable elements of the specified array.
|
public static final org.slf4j.Logger logio
public static <K,V> void smartWrite(ObjectOutputStream s, Map<K,V> map) throws IOException
IOExceptionpublic static <K,V> Map<K,V> smartRead(ObjectInputStream s, Map<K,V> map) throws IOException, ClassNotFoundException
smartWrite(ObjectOutputStream,Map)).map - the map to hold the data being read. If null and any data
is read, a new map (HashMap) is created and returned.IOExceptionClassNotFoundExceptionpublic static <T> void smartWrite(ObjectOutputStream s, Collection<T> col) throws IOException
IOExceptionpublic static <T> Collection<T> smartRead(ObjectInputStream s, Collection<T> col) throws IOException, ClassNotFoundException
smartWrite(ObjectOutputStream,Collection))col - the collection to hold the data being read. If null and
and data is read, a new collection (LinkedList) is created and returned.IOExceptionClassNotFoundExceptionpublic static <T> List<T> smartRead(ObjectInputStream s, List<T> col) throws IOException, ClassNotFoundException
smartWrite(ObjectOutputStream,Collection))col - the collection to hold the data being read. If null and
and data is read, a new collection (LinkedList) is created and returned.IOExceptionClassNotFoundExceptionpublic static <T> void smartWrite(ObjectOutputStream s, T[] ary) throws IOException
To read back, use smartRead(ObjectInputStream, Collection).
IOExceptionpublic static void smartWrite(ObjectOutputStream s, Object val) throws IOException
IOExceptionCopyright © 2018. All rights reserved.