public class DefaultExternalizableUtil extends Object implements ExternalizableUtilStrategy
| Constructor and Description |
|---|
DefaultExternalizableUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Class<?> |
loadClass(ClassLoader classLoader,
String className) |
static Class<?> |
loadClass(String className) |
static ObjectInputStream |
newObjectInputStream(InputStream in) |
boolean |
readBoolean(DataInput in) |
byte[] |
readByteArray(DataInput in) |
int |
readExternalizableCollection(DataInput in,
Collection<? extends Externalizable> value,
ClassLoader loader)
Reads a collection of Externalizable objects and adds them to the collection passed as a parameter.
|
int |
readExternalizableMap(DataInput in,
Map<String,? extends Externalizable> map,
ClassLoader loader)
Reads a Map of String key and value pairs.
|
int |
readInt(DataInput in) |
long |
readLong(DataInput in) |
long[] |
readLongArray(DataInput in)
Reads an array of long values.
|
Map<Long,Integer> |
readLongIntMap(DataInput in)
Reads a Map of Long key and Integer value pairs.
|
static Object |
readObject(DataInput in) |
String |
readSafeUTF(DataInput in) |
Serializable |
readSerializable(DataInput in) |
int |
readSerializableCollection(DataInput in,
Collection<? extends Serializable> value,
ClassLoader loader)
Reads a collection of Serializable objects and adds them to the collection passed as a parameter.
|
int |
readSerializableMap(DataInput in,
Map<? extends Serializable,? extends Serializable> map,
ClassLoader loader)
Reads a Map of Serializable key and value pairs.
|
List<String> |
readStringList(DataInput in)
Reads a List of Strings.
|
Map<String,String> |
readStringMap(DataInput in)
Reads a Map of String key and value pairs.
|
int |
readStrings(DataInput in,
Collection<String> collection) |
int |
readStringsMap(DataInput in,
Map<String,Set<String>> map)
Reads a Map of String key and Set of Strings value pairs.
|
void |
writeBoolean(DataOutput out,
boolean value) |
void |
writeByteArray(DataOutput out,
byte[] value) |
void |
writeExternalizableCollection(DataOutput out,
Collection<? extends Externalizable> value)
Writes a collection of Externalizable objects.
|
void |
writeExternalizableMap(DataOutput out,
Map<String,? extends Externalizable> map)
Writes a Map of String key and value pairs.
|
void |
writeInt(DataOutput out,
int value) |
void |
writeLong(DataOutput out,
long value) |
void |
writeLongArray(DataOutput out,
long[] array)
Writes an array of long values.
|
void |
writeLongIntMap(DataOutput out,
Map<Long,Integer> map)
Writes a Map of Long key and Integer value pairs.
|
static void |
writeObject(DataOutput out,
Object obj) |
void |
writeSafeUTF(DataOutput out,
String value) |
void |
writeSerializable(DataOutput out,
Serializable value) |
void |
writeSerializableCollection(DataOutput out,
Collection<? extends Serializable> value)
Writes a collection of Serializable objects.
|
void |
writeSerializableMap(DataOutput out,
Map<? extends Serializable,? extends Serializable> map)
Writes a Map of Serializable key and value pairs.
|
void |
writeStringList(DataOutput out,
List<String> stringList)
Writes a List of Strings.
|
void |
writeStringMap(DataOutput out,
Map<String,String> stringMap)
Writes a Map of String key and value pairs.
|
void |
writeStrings(DataOutput out,
Collection<String> collection) |
void |
writeStringsMap(DataOutput out,
Map<String,Set<String>> map)
Writes a Map of String key and Set of Strings value pairs.
|
public void writeStringMap(DataOutput out, Map<String,String> stringMap) throws IOException
writeStringMap in interface ExternalizableUtilStrategyout - the output stream.stringMap - the Map of String key/value pairs.IOException - if an error occurs.public Map<String,String> readStringMap(DataInput in) throws IOException
readStringMap in interface ExternalizableUtilStrategyin - the input stream.IOException - if an error occurs.public void writeStringsMap(DataOutput out, Map<String,Set<String>> map) throws IOException
writeStringsMap in interface ExternalizableUtilStrategyout - the output stream.map - the Map of String key and Set of Strings value pairs.IOException - if an error occurs.public int readStringsMap(DataInput in, Map<String,Set<String>> map) throws IOException
readStringsMap in interface ExternalizableUtilStrategyin - the input stream.map - a Map of String key and Set of Strings value pairs.IOException - if an error occurs.public void writeLongIntMap(DataOutput out, Map<Long,Integer> map) throws IOException
writeLongIntMap in interface ExternalizableUtilStrategyout - the output stream.map - the Map of Long key/Integer value pairs.IOException - if an error occurs.public Map<Long,Integer> readLongIntMap(DataInput in) throws IOException
readLongIntMap in interface ExternalizableUtilStrategyin - the input stream.IOException - if an error occurs.public void writeStringList(DataOutput out, List<String> stringList) throws IOException
writeStringList in interface ExternalizableUtilStrategyout - the output stream.stringList - the List of Strings.IOException - if an error occurs.public List<String> readStringList(DataInput in) throws IOException
readStringList in interface ExternalizableUtilStrategyin - the input stream.IOException - if an error occurs.public void writeLongArray(DataOutput out, long[] array) throws IOException
writeLongArray in interface ExternalizableUtilStrategyout - the output stream.array - the array of long values.IOException - if an error occurs.public long[] readLongArray(DataInput in) throws IOException
readLongArray in interface ExternalizableUtilStrategyin - the input stream.IOException - if an error occurs.public void writeLong(DataOutput out, long value) throws IOException
writeLong in interface ExternalizableUtilStrategyIOExceptionpublic long readLong(DataInput in) throws IOException
readLong in interface ExternalizableUtilStrategyIOExceptionpublic void writeByteArray(DataOutput out, byte[] value) throws IOException
writeByteArray in interface ExternalizableUtilStrategyIOExceptionpublic byte[] readByteArray(DataInput in) throws IOException
readByteArray in interface ExternalizableUtilStrategyIOExceptionpublic void writeInt(DataOutput out, int value) throws IOException
writeInt in interface ExternalizableUtilStrategyIOExceptionpublic int readInt(DataInput in) throws IOException
readInt in interface ExternalizableUtilStrategyIOExceptionpublic void writeBoolean(DataOutput out, boolean value) throws IOException
writeBoolean in interface ExternalizableUtilStrategyIOExceptionpublic boolean readBoolean(DataInput in) throws IOException
readBoolean in interface ExternalizableUtilStrategyIOExceptionpublic void writeSerializable(DataOutput out, Serializable value) throws IOException
writeSerializable in interface ExternalizableUtilStrategyIOExceptionpublic Serializable readSerializable(DataInput in) throws IOException
readSerializable in interface ExternalizableUtilStrategyIOExceptionpublic void writeSafeUTF(DataOutput out, String value) throws IOException
writeSafeUTF in interface ExternalizableUtilStrategyIOExceptionpublic String readSafeUTF(DataInput in) throws IOException
readSafeUTF in interface ExternalizableUtilStrategyIOExceptionpublic void writeExternalizableCollection(DataOutput out, Collection<? extends Externalizable> value) throws IOException
writeExternalizableCollection in interface ExternalizableUtilStrategyout - the output stream.value - the collection of Externalizable objects. This value must not be null.IOException - if an error occurs.public void writeSerializableCollection(DataOutput out, Collection<? extends Serializable> value) throws IOException
writeSerializableCollection in interface ExternalizableUtilStrategyout - the output stream.value - the collection of Serializable objects. This value must not be null.IOException - if an error occurs.public int readExternalizableCollection(DataInput in, Collection<? extends Externalizable> value, ClassLoader loader) throws IOException
readExternalizableCollection in interface ExternalizableUtilStrategyin - the input stream.value - the collection of Externalizable objects. This value must not be null.loader - class loader to use to build elements inside of the serialized collection.IOException - if an error occurs.public int readSerializableCollection(DataInput in, Collection<? extends Serializable> value, ClassLoader loader) throws IOException
readSerializableCollection in interface ExternalizableUtilStrategyin - the input stream.value - the collection of Serializable objects. This value must not be null.loader - class loader to use to build elements inside of the serialized collection.IOException - if an error occurs.public void writeExternalizableMap(DataOutput out, Map<String,? extends Externalizable> map) throws IOException
writeExternalizableMap in interface ExternalizableUtilStrategyout - the output stream.map - the Map of String key and Externalizable value pairs.IOException - if an error occurs.public void writeSerializableMap(DataOutput out, Map<? extends Serializable,? extends Serializable> map) throws IOException
writeSerializableMap in interface ExternalizableUtilStrategyout - the output stream.map - the Map of Serializable key and value pairs.IOException - if an error occurs.public int readExternalizableMap(DataInput in, Map<String,? extends Externalizable> map, ClassLoader loader) throws IOException
readExternalizableMap in interface ExternalizableUtilStrategyin - the input stream.map - a Map of String key and Externalizable value pairs.loader - class loader to use to build elements inside of the serialized collection.IOException - if an error occurs.public int readSerializableMap(DataInput in, Map<? extends Serializable,? extends Serializable> map, ClassLoader loader) throws IOException
readSerializableMap in interface ExternalizableUtilStrategyin - the input stream.map - a Map of Serializable key and value pairs.loader - class loader to use to build elements inside of the serialized collection.IOException - if an error occurs.public void writeStrings(DataOutput out, Collection<String> collection) throws IOException
writeStrings in interface ExternalizableUtilStrategyIOExceptionpublic int readStrings(DataInput in, Collection<String> collection) throws IOException
readStrings in interface ExternalizableUtilStrategyIOExceptionpublic static void writeObject(DataOutput out, Object obj) throws IOException
IOExceptionpublic static Object readObject(DataInput in) throws IOException
IOExceptionpublic static ObjectInputStream newObjectInputStream(InputStream in) throws IOException
IOExceptionpublic static Class<?> loadClass(String className) throws ClassNotFoundException
ClassNotFoundExceptionpublic static Class<?> loadClass(ClassLoader classLoader, String className) throws ClassNotFoundException
ClassNotFoundExceptionCopyright © 2003–2020 Ignite Realtime. All rights reserved.