Gemfire JavaDocs
Class DataSerializer
- java.lang.Object
-
- org.apache.geode.DataSerializer
-
public abstract class DataSerializer extends java.lang.Object
Provides static helper methods for reading and writing non-primitive data when working with aDataSerializable
. For instance, classes that implementDataSerializable
can use theDataSerializer
in theirtoData
andfromData
methods:public class Employee implements DataSerializable { private int id; private String name; private Date birthday; private Company employer; public void toData(DataOutput out) throws IOException { out.writeInt(this.id); out.writeUTF(this.name); DataSerializer.writeDate(this.birthday, out); DataSerializer.writeObject(this.employer, out); } public void fromData(DataInput in) throws IOException, ClassNotFoundException { this.id = in.readInt(); this.name = in.readUTF(); this.birthday = DataSerializer.readDate(in); this.employer = (Company) DataSerializer.readObject(in); } }
Instances of
DataSerializer
are used to data serialize objects (such as instances of standard Java classes or third-party classes for which the source code is not available) that do not implement theDataSerializable
interface.The following
DataSerializer
data serializes instances ofCompany
. In order for the data serialization framework to consult this custom serializer, it must be registered with the framework.public class CompanySerializer extends DataSerializer { static { DataSerializer.register(CompanySerializer.class); } /** May be invoked reflectively if instances of Company are distributed to other VMs. / public CompanySerializer() { } public Class[] getSupportedClasses() { return new Class[] { Company.class }; } public int getId() { return 42; } public boolean toData(Object o, DataOutput out) throws IOException { if (o instanceof Company) { Company company = (Company) o; out.writeUTF(company.getName()); // Let's assume that Address is java.io.Serializable Address address = company.getAddress(); writeObject(address, out); return true; } else { return false; } } public Object fromData(DataInput in) throws IOException, ClassNotFoundException { String name = in.readUTF(); Address address = (Address) readObject(in); return new Company(name, address); } }
Just likeInstantiator
s, aDataSerializer
may be sent to other members of the distributed system when it is registered. The data serialization framework does not require that aDataSerializer
beSerializable
, but it does require that it provide a zero-argument constructor.- Since:
- GemFire 3.5
- See Also:
writeObject(Object, DataOutput)
,readObject(java.io.DataInput)
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.ThreadLocal<java.lang.Boolean>
DISALLOW_JAVA_SERIALIZATION
protected static boolean
TRACE_SERIALIZABLE
Deprecated.Use Boolean.getBoolean("DataSerializer.TRACE_SERIALIZABLE") instead.
-
Constructor Summary
Constructors Constructor Description DataSerializer()
Creates a newDataSerializer
.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
TwoDataSerializer
s are consider to be equal if they have the same id and the same classabstract java.lang.Object
fromData(java.io.DataInput in)
Reads an object from aDataInput
.java.lang.Object
getContext()
For internal use only.java.lang.Object
getEventId()
For internal use only.abstract int
getId()
Returns the id of thisDataSerializer
.abstract java.lang.Class<?>[]
getSupportedClasses()
Returns theClass
es whose instances are data serialized by thisDataSerializer
.int
hashCode()
static <E> java.util.ArrayList<E>
readArrayList(java.io.DataInput in)
Reads anArrayList
from aDataInput
.static byte[][]
readArrayOfByteArrays(java.io.DataInput in)
Reads an array ofbyte[]
s from aDataInput
.static java.lang.Boolean
readBoolean(java.io.DataInput in)
Reads an instance ofBoolean
from aDataInput
.static boolean[]
readBooleanArray(java.io.DataInput in)
Reads an array ofboolean
s from aDataInput
.static java.lang.Byte
readByte(java.io.DataInput in)
Reads an instance ofByte
from aDataInput
.static byte[]
readByteArray(java.io.DataInput in)
Reads an array ofbyte
s from aDataInput
.static java.lang.Character
readCharacter(java.io.DataInput in)
Reads an instance ofCharacter
from aDataInput
.static char[]
readCharArray(java.io.DataInput in)
Reads an array ofchar
s from aDataInput
.static java.lang.Class<?>
readClass(java.io.DataInput in)
Reads an instance ofClass
from aDataInput
.static <K,V>
java.util.concurrent.ConcurrentHashMap<K,V>readConcurrentHashMap(java.io.DataInput in)
Reads aConcurrentHashMap
from aDataInput
.static java.util.Date
readDate(java.io.DataInput in)
Reads an instance ofDate
from aDataInput
.static java.lang.Double
readDouble(java.io.DataInput in)
Reads an instance ofDouble
from aDataInput
.static double[]
readDoubleArray(java.io.DataInput in)
Reads an array ofdouble
s from aDataInput
.static <E extends java.lang.Enum<E>>
EreadEnum(java.lang.Class<E> clazz, java.io.DataInput in)
Reads aEnum constant
fromDataInput
.static java.io.File
readFile(java.io.DataInput in)
Reads an instance ofFile
from aDataInput
.static java.lang.Float
readFloat(java.io.DataInput in)
Reads an instance ofFloat
from aDataInput
.static float[]
readFloatArray(java.io.DataInput in)
Reads an array offloat
s from aDataInput
.static <K,V>
java.util.HashMap<K,V>readHashMap(java.io.DataInput in)
Reads aHashMap
from aDataInput
.static <E> java.util.HashSet<E>
readHashSet(java.io.DataInput in)
Reads aHashSet
from aDataInput
.static <K,V>
java.util.Hashtable<K,V>readHashtable(java.io.DataInput in)
Reads aHashtable
from aDataInput
.static <K,V>
java.util.IdentityHashMap<K,V>readIdentityHashMap(java.io.DataInput in)
Reads aIdentityHashMap
from aDataInput
.static java.net.InetAddress
readInetAddress(java.io.DataInput in)
Reads an instance ofInetAddress
from aDataInput
.static int[]
readIntArray(java.io.DataInput in)
Reads anint
array from aDataInput
.static java.lang.Integer
readInteger(java.io.DataInput in)
Reads an instance ofInteger
from aDataInput
.static <K,V>
java.util.LinkedHashMap<K,V>readLinkedHashMap(java.io.DataInput in)
Reads aLinkedHashMap
from aDataInput
.static <E> java.util.LinkedHashSet<E>
readLinkedHashSet(java.io.DataInput in)
Reads aLinkedHashSet
from aDataInput
.static <E> java.util.LinkedList<E>
readLinkedList(java.io.DataInput in)
Reads anLinkedList
from aDataInput
.static java.lang.Long
readLong(java.io.DataInput in)
Reads an instance ofLong
from aDataInput
.static long[]
readLongArray(java.io.DataInput in)
Reads an array oflong
s from aDataInput
.static java.lang.String
readNonPrimitiveClassName(java.io.DataInput in)
Reads name of an instance ofClass
from aDataInput
.static <T> T
readObject(java.io.DataInput in)
Reads an arbitrary object from aDataInput
.static java.lang.Object[]
readObjectArray(java.io.DataInput in)
Reads an array ofObject
s from aDataInput
.static boolean
readPrimitiveBoolean(java.io.DataInput in)
Reads a primitiveboolean
from aDataInput
.static byte
readPrimitiveByte(java.io.DataInput in)
Reads a primitivebyte
from aDataInput
.static char
readPrimitiveChar(java.io.DataInput in)
Reads a primitivechar
from aDataInput
.static double
readPrimitiveDouble(java.io.DataInput in)
Reads a primitivedouble
from aDataInput
.static float
readPrimitiveFloat(java.io.DataInput in)
Reads a primitivefloat
from aDataInput
.static int
readPrimitiveInt(java.io.DataInput in)
Reads a primitiveint
from aDataInput
.static long
readPrimitiveLong(java.io.DataInput in)
Reads a primitivelong
from aDataInput
.static short
readPrimitiveShort(java.io.DataInput in)
Reads a primitiveshort
from aDataInput
.static java.util.Properties
readProperties(java.io.DataInput in)
Reads aProperties
from aDataInput
.static <K,V>
Region<K,V>readRegion(java.io.DataInput in)
Reads an instance of Region.static java.lang.Short
readShort(java.io.DataInput in)
Reads an instance ofShort
from aDataInput
.static short[]
readShortArray(java.io.DataInput in)
Reads an array ofshort
s from aDataInput
.static <E> java.util.Stack<E>
readStack(java.io.DataInput in)
Reads anStack
from aDataInput
.static java.lang.String
readString(java.io.DataInput in)
Reads an instance ofString
from aDataInput
.static java.lang.String[]
readStringArray(java.io.DataInput in)
Reads an array ofString
s from aDataInput
.static <K,V>
java.util.TreeMap<K,V>readTreeMap(java.io.DataInput in)
Reads aTreeMap
from aDataInput
.static <E> java.util.TreeSet<E>
readTreeSet(java.io.DataInput in)
Reads aTreeSet
from aDataInput
.static int
readUnsignedByte(java.io.DataInput in)
Reads a primitiveint
as an unsigned byte from aDataInput
usingDataInput.readUnsignedByte()
.static int
readUnsignedShort(java.io.DataInput in)
Reads a primitiveint
as an unsigned short from aDataInput
usingDataInput.readUnsignedShort()
.static <E> java.util.Vector<E>
readVector(java.io.DataInput in)
Reads anVector
from aDataInput
.static DataSerializer
register(java.lang.Class<?> c)
Registers aDataSerializer
class with the data serialization framework.void
setContext(java.lang.Object context)
For internal use only.void
setEventId(java.lang.Object eventId)
For internal use only.abstract boolean
toData(java.lang.Object o, java.io.DataOutput out)
Data serializes an object to aDataOutput
.static void
writeArrayList(java.util.ArrayList<?> list, java.io.DataOutput out)
Writes anArrayList
to aDataOutput
.static void
writeArrayOfByteArrays(byte[][] array, java.io.DataOutput out)
Writes an array ofbyte[]
to aDataOutput
.static void
writeBoolean(java.lang.Boolean value, java.io.DataOutput out)
Writes an instance ofBoolean
to aDataOutput
.static void
writeBooleanArray(boolean[] array, java.io.DataOutput out)
Writes an array ofboolean
s to aDataOutput
.static void
writeByte(java.lang.Byte value, java.io.DataOutput out)
Writes an instance ofByte
to aDataOutput
.static void
writeByteArray(byte[] array, int len, java.io.DataOutput out)
Writes the firstlen
elements of an array ofbyte
s to aDataOutput
.static void
writeByteArray(byte[] array, java.io.DataOutput out)
Writes an array ofbyte
s to aDataOutput
.static void
writeCharacter(java.lang.Character value, java.io.DataOutput out)
Writes an instance ofCharacter
to aDataOutput
.static void
writeCharArray(char[] array, java.io.DataOutput out)
Writes an array ofchar
s to aDataOutput
.static void
writeClass(java.lang.Class<?> c, java.io.DataOutput out)
Writes an instance ofClass
to aDataOutput
.static void
writeConcurrentHashMap(java.util.concurrent.ConcurrentHashMap<?,?> map, java.io.DataOutput out)
Writes aConcurrentHashMap
to aDataOutput
.static void
writeDate(java.util.Date date, java.io.DataOutput out)
Writes an instance ofDate
to aDataOutput
.static void
writeDouble(java.lang.Double value, java.io.DataOutput out)
Writes an instance ofDouble
to aDataOutput
.static void
writeDoubleArray(double[] array, java.io.DataOutput out)
Writes an array ofdouble
s to aDataOutput
.static void
writeEnum(java.lang.Enum<?> e, java.io.DataOutput out)
Writes theEnum constant
toDataOutput
.static void
writeFile(java.io.File file, java.io.DataOutput out)
Writes an instance ofFile
to aDataOutput
.static void
writeFloat(java.lang.Float value, java.io.DataOutput out)
Writes an instance ofFloat
to aDataOutput
.static void
writeFloatArray(float[] array, java.io.DataOutput out)
Writes an array offloat
s to aDataOutput
.static void
writeHashMap(java.util.Map<?,?> map, java.io.DataOutput out)
Writes aHashMap
to aDataOutput
.static void
writeHashSet(java.util.HashSet<?> set, java.io.DataOutput out)
Writes aHashSet
to aDataOutput
.static void
writeHashtable(java.util.Hashtable<?,?> map, java.io.DataOutput out)
Writes aHashtable
to aDataOutput
.static void
writeIdentityHashMap(java.util.IdentityHashMap<?,?> map, java.io.DataOutput out)
Writes aIdentityHashMap
to aDataOutput
.static void
writeInetAddress(java.net.InetAddress address, java.io.DataOutput out)
Writes an instance ofInetAddress
to aDataOutput
.static void
writeIntArray(int[] array, java.io.DataOutput out)
Writes anint
array to aDataOutput
.static void
writeInteger(java.lang.Integer value, java.io.DataOutput out)
Writes an instance ofInteger
to aDataOutput
.static void
writeLinkedHashMap(java.util.Map<?,?> map, java.io.DataOutput out)
Writes aLinkedHashMap
to aDataOutput
.static void
writeLinkedHashSet(java.util.LinkedHashSet<?> set, java.io.DataOutput out)
Writes aLinkedHashSet
to aDataOutput
.static void
writeLinkedList(java.util.LinkedList<?> list, java.io.DataOutput out)
Writes anLinkedList
to aDataOutput
.static void
writeLong(java.lang.Long value, java.io.DataOutput out)
Writes an instance ofLong
to aDataOutput
.static void
writeLongArray(long[] array, java.io.DataOutput out)
Writes an array oflong
s to aDataOutput
.static void
writeNonPrimitiveClassName(java.lang.String className, java.io.DataOutput out)
Writes class name to aDataOutput
.static void
writeObject(java.lang.Object o, java.io.DataOutput out)
Writes an arbitrary object to aDataOutput
.static void
writeObject(java.lang.Object o, java.io.DataOutput out, boolean allowJavaSerialization)
Writes an arbitrary object to aDataOutput
.static void
writeObjectArray(java.lang.Object[] array, java.io.DataOutput out)
Writes an array ofObject
s to aDataOutput
.static void
writeObjectAsByteArray(java.lang.Object obj, java.io.DataOutput out)
Serialize the given objectobj
into a byte array usingwriteObject(Object, DataOutput)
and then writes the byte array to the given data outputout
in the same formatwriteByteArray(byte[], DataOutput)
does.static void
writePrimitiveBoolean(boolean value, java.io.DataOutput out)
Writes a primitiveboolean
to aDataOutput
.static void
writePrimitiveByte(byte value, java.io.DataOutput out)
Writes a primitivebyte
to aDataOutput
.static void
writePrimitiveChar(char value, java.io.DataOutput out)
Writes a primitivechar
to aDataOutput
.static void
writePrimitiveDouble(double value, java.io.DataOutput out)
Writes a primtivedouble
to aDataOutput
.static void
writePrimitiveFloat(float value, java.io.DataOutput out)
Writes a primitivefloat
to aDataOutput
.static void
writePrimitiveInt(int value, java.io.DataOutput out)
Writes a primitiveint
to aDataOutput
.static void
writePrimitiveLong(long value, java.io.DataOutput out)
Writes a primitivelong
to aDataOutput
.static void
writePrimitiveShort(short value, java.io.DataOutput out)
Writes a primitiveshort
to aDataOutput
.static void
writeProperties(java.util.Properties props, java.io.DataOutput out)
Writes aProperties
to aDataOutput
.static void
writeRegion(Region<?,?> rgn, java.io.DataOutput out)
Writes an instance of Region.static void
writeShort(java.lang.Short value, java.io.DataOutput out)
Writes an instance ofShort
to aDataOutput
.static void
writeShortArray(short[] array, java.io.DataOutput out)
Writes an array ofshort
s to aDataOutput
.static void
writeStack(java.util.Stack<?> list, java.io.DataOutput out)
Writes anStack
to aDataOutput
.static void
writeString(java.lang.String value, java.io.DataOutput out)
Writes an instance ofString
to aDataOutput
.static void
writeStringArray(java.lang.String[] array, java.io.DataOutput out)
Writes an array ofString
s to aDataOutput
.static void
writeTreeMap(java.util.TreeMap<?,?> map, java.io.DataOutput out)
Writes aTreeMap
to aDataOutput
.static void
writeTreeSet(java.util.TreeSet<?> set, java.io.DataOutput out)
Writes aTreeSet
to aDataOutput
.static void
writeUnsignedByte(int value, java.io.DataOutput out)
Writes a primitiveint
as an unsigned byte to aDataOutput
.static void
writeUnsignedShort(int value, java.io.DataOutput out)
Writes a primitiveint
as an unsigned short to aDataOutput
.static void
writeVector(java.util.Vector<?> list, java.io.DataOutput out)
Writes anVector
to aDataOutput
.
-
-
-
Constructor Detail
-
DataSerializer
public DataSerializer()
Creates a newDataSerializer
. All class that implementDataSerializer
must provide a zero-argument constructor.- See Also:
register(Class)
-
-
Method Detail
-
writeClass
public static void writeClass(java.lang.Class<?> c, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofClass
to aDataOutput
. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
c
- theClass
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readClass(java.io.DataInput)
-
writeNonPrimitiveClassName
public static void writeNonPrimitiveClassName(java.lang.String className, java.io.DataOutput out) throws java.io.IOException
Writes class name to aDataOutput
. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
className
- the class name to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readNonPrimitiveClassName(DataInput)
-
readClass
public static java.lang.Class<?> readClass(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads an instance ofClass
from aDataInput
. The class will be loaded using the current content class loader. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Class
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class cannot be loaded
-
readNonPrimitiveClassName
public static java.lang.String readNonPrimitiveClassName(java.io.DataInput in) throws java.io.IOException
Reads name of an instance ofClass
from aDataInput
. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized Class name
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeNonPrimitiveClassName(String, DataOutput)
-
writeRegion
public static void writeRegion(Region<?,?> rgn, java.io.DataOutput out) throws java.io.IOException
Writes an instance of Region. A Region is serialized as just a reference to a full path only. It will be recreated on the other end by callingCacheFactory.getAnyInstance()
and then callinggetRegion
on it. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
rgn
- the Region to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- if a problem occurs while reading fromin
-
readRegion
public static <K,V> Region<K,V> readRegion(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads an instance of Region. A Region is serialized as a reference to a full path only. It is recreated on the other end by callingCacheFactory.getAnyInstance()
and then callinggetRegion
on it. The return value may benull
.- Type Parameters:
K
- the type of keys in the regionV
- the type of values in the region- Parameters:
in
- the input stream- Returns:
- the Region instance
- Throws:
CacheClosedException
- if a cache has not been created or the only created one is closed.RegionNotFoundException
- if there is no region by this name in the Cachejava.io.IOException
- if a problem occurs while reading fromin
java.lang.ClassNotFoundException
- if the class of one of the Region's elements cannot be found.
-
writeDate
public static void writeDate(java.util.Date date, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofDate
to aDataOutput
. Note that even thoughdate
may be an instance of a subclass ofDate
,readDate
will always return an instance ofDate
, not an instance of the subclass. To preserve the class type ofdate
,\writeObject(Object, DataOutput)
should be used for data serialization. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
date
- theDate
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readDate(java.io.DataInput)
-
readDate
public static java.util.Date readDate(java.io.DataInput in) throws java.io.IOException
Reads an instance ofDate
from aDataInput
. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Date
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeFile
public static void writeFile(java.io.File file, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofFile
to aDataOutput
. Note that even thoughfile
may be an instance of a subclass ofFile
,readFile
will always return an instance ofFile
, not an instance of the subclass. To preserve the class type offile
,writeObject(Object, DataOutput)
should be used for data serialization. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
file
- theFile
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readFile(java.io.DataInput)
,File.getCanonicalPath()
-
readFile
public static java.io.File readFile(java.io.DataInput in) throws java.io.IOException
Reads an instance ofFile
from aDataInput
. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
File
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeInetAddress
public static void writeInetAddress(java.net.InetAddress address, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofInetAddress
to aDataOutput
. TheInetAddress
is data serialized by writing itsbyte
representation to theDataOutput
.readInetAddress(java.io.DataInput)
converts thebyte
representation to an instance ofInetAddress
usingInetAddress.getAddress()
. As a result, ifaddress
is an instance of a user-defined subclass ofInetAddress
(that is, not an instance of one of the subclasses from thejava.net
package), its class will not be preserved. In order to be able to read an instance of the user-defined class,writeObject(Object, DataOutput)
should be used. This method will handle anull
value and not throw aNullPointerException
.- Parameters:
address
- theInetAddress
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readInetAddress(java.io.DataInput)
-
readInetAddress
public static java.net.InetAddress readInetAddress(java.io.DataInput in) throws java.io.IOException
Reads an instance ofInetAddress
from aDataInput
. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
InetAddress
- Throws:
java.io.IOException
- A problem occurs while reading fromin
or the address read fromin
is unknown- See Also:
InetAddress.getAddress()
-
writeString
public static void writeString(java.lang.String value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofString
to aDataOutput
. This method will handle anull
value and not throw aNullPointerException
.As of 5.7 strings longer than 0xFFFF can be serialized.
- Parameters:
value
- theString
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readString(java.io.DataInput)
-
readString
public static java.lang.String readString(java.io.DataInput in) throws java.io.IOException
Reads an instance ofString
from aDataInput
. The return value may benull
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
String
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeString(java.lang.String, java.io.DataOutput)
-
writeBoolean
public static void writeBoolean(java.lang.Boolean value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofBoolean
to aDataOutput
.- Parameters:
value
- theBoolean
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readBoolean(java.io.DataInput)
-
readBoolean
public static java.lang.Boolean readBoolean(java.io.DataInput in) throws java.io.IOException
Reads an instance ofBoolean
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Boolean
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeCharacter
public static void writeCharacter(java.lang.Character value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofCharacter
to aDataOutput
.- Parameters:
value
- theCharacter
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readCharacter(java.io.DataInput)
-
readCharacter
public static java.lang.Character readCharacter(java.io.DataInput in) throws java.io.IOException
Reads an instance ofCharacter
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Character
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeByte
public static void writeByte(java.lang.Byte value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofByte
to aDataOutput
.- Parameters:
value
- theByte
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readByte(java.io.DataInput)
-
readByte
public static java.lang.Byte readByte(java.io.DataInput in) throws java.io.IOException
Reads an instance ofByte
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Byte
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeShort
public static void writeShort(java.lang.Short value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofShort
to aDataOutput
.- Parameters:
value
- theShort
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readShort(java.io.DataInput)
-
readShort
public static java.lang.Short readShort(java.io.DataInput in) throws java.io.IOException
Reads an instance ofShort
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Short
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeInteger
public static void writeInteger(java.lang.Integer value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofInteger
to aDataOutput
.- Parameters:
value
- theInteger
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readInteger(java.io.DataInput)
-
readInteger
public static java.lang.Integer readInteger(java.io.DataInput in) throws java.io.IOException
Reads an instance ofInteger
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Integer
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeLong
public static void writeLong(java.lang.Long value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofLong
to aDataOutput
.- Parameters:
value
- theLong
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readLong(java.io.DataInput)
-
readLong
public static java.lang.Long readLong(java.io.DataInput in) throws java.io.IOException
Reads an instance ofLong
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Long
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeFloat
public static void writeFloat(java.lang.Float value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofFloat
to aDataOutput
.- Parameters:
value
- theFloat
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readFloat(java.io.DataInput)
-
readFloat
public static java.lang.Float readFloat(java.io.DataInput in) throws java.io.IOException
Reads an instance ofFloat
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Float
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeDouble
public static void writeDouble(java.lang.Double value, java.io.DataOutput out) throws java.io.IOException
Writes an instance ofDouble
to aDataOutput
.- Parameters:
value
- theDouble
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
java.lang.NullPointerException
- if value is null.- See Also:
readDouble(java.io.DataInput)
-
readDouble
public static java.lang.Double readDouble(java.io.DataInput in) throws java.io.IOException
Reads an instance ofDouble
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Double
- Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writePrimitiveBoolean
public static void writePrimitiveBoolean(boolean value, java.io.DataOutput out) throws java.io.IOException
Writes a primitiveboolean
to aDataOutput
.- Parameters:
value
- the primitiveboolean
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeBoolean(boolean)
-
readPrimitiveBoolean
public static boolean readPrimitiveBoolean(java.io.DataInput in) throws java.io.IOException
Reads a primitiveboolean
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
boolean
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readBoolean()
-
writePrimitiveByte
public static void writePrimitiveByte(byte value, java.io.DataOutput out) throws java.io.IOException
Writes a primitivebyte
to aDataOutput
.- Parameters:
value
- the primitivebyte
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeByte(int)
-
readPrimitiveByte
public static byte readPrimitiveByte(java.io.DataInput in) throws java.io.IOException
Reads a primitivebyte
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
byte
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readByte()
-
writePrimitiveChar
public static void writePrimitiveChar(char value, java.io.DataOutput out) throws java.io.IOException
Writes a primitivechar
to aDataOutput
.- Parameters:
value
- the primitivechar
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeChar(int)
-
readPrimitiveChar
public static char readPrimitiveChar(java.io.DataInput in) throws java.io.IOException
Reads a primitivechar
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
char
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readChar()
-
writePrimitiveShort
public static void writePrimitiveShort(short value, java.io.DataOutput out) throws java.io.IOException
Writes a primitiveshort
to aDataOutput
.- Parameters:
value
- the primitiveshort
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeShort(int)
-
readPrimitiveShort
public static short readPrimitiveShort(java.io.DataInput in) throws java.io.IOException
Reads a primitiveshort
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
short
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readShort()
-
writeUnsignedByte
public static void writeUnsignedByte(int value, java.io.DataOutput out) throws java.io.IOException
Writes a primitiveint
as an unsigned byte to aDataOutput
.- Parameters:
value
- the primitiveint
as an unsigned byte to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeByte(int)
,DataInput.readUnsignedByte()
-
readUnsignedByte
public static int readUnsignedByte(java.io.DataInput in) throws java.io.IOException
Reads a primitiveint
as an unsigned byte from aDataInput
usingDataInput.readUnsignedByte()
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
int
as an unsigned byte - Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
-
writeUnsignedShort
public static void writeUnsignedShort(int value, java.io.DataOutput out) throws java.io.IOException
Writes a primitiveint
as an unsigned short to aDataOutput
.- Parameters:
value
- the primitiveint
as an unsigned short to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeShort(int)
,DataInput.readUnsignedShort()
-
readUnsignedShort
public static int readUnsignedShort(java.io.DataInput in) throws java.io.IOException
Reads a primitiveint
as an unsigned short from aDataInput
usingDataInput.readUnsignedShort()
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized primitive
int
as an unsigned short - Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
-
writePrimitiveInt
public static void writePrimitiveInt(int value, java.io.DataOutput out) throws java.io.IOException
Writes a primitiveint
to aDataOutput
.- Parameters:
value
- the primitiveint
to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
DataOutput.writeInt(int)
-
readPrimitiveInt
public static int readPrimitiveInt(java.io.DataInput in) throws java.io.IOException
Reads a primitiveint
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- a primitive
int
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readInt()
-
writePrimitiveLong
public static void writePrimitiveLong(long value, java.io.DataOutput out) throws java.io.IOException
Writes a primitivelong
to aDataOutput
.- Parameters:
value
- the primitivelong
to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeLong(long)
-
readPrimitiveLong
public static long readPrimitiveLong(java.io.DataInput in) throws java.io.IOException
Reads a primitivelong
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- a primitive
long
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readLong()
-
writePrimitiveFloat
public static void writePrimitiveFloat(float value, java.io.DataOutput out) throws java.io.IOException
Writes a primitivefloat
to aDataOutput
.- Parameters:
value
- the primitivefloat
to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeFloat(float)
-
readPrimitiveFloat
public static float readPrimitiveFloat(java.io.DataInput in) throws java.io.IOException
Reads a primitivefloat
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- a primitive
float
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readFloat()
-
writePrimitiveDouble
public static void writePrimitiveDouble(double value, java.io.DataOutput out) throws java.io.IOException
Writes a primtivedouble
to aDataOutput
.- Parameters:
value
- the primitivedouble
to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.1
- See Also:
DataOutput.writeDouble(double)
-
readPrimitiveDouble
public static double readPrimitiveDouble(java.io.DataInput in) throws java.io.IOException
Reads a primitivedouble
from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- a primitive
double
- Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.1
- See Also:
DataInput.readDouble()
-
writeByteArray
public static void writeByteArray(byte[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofbyte
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofbyte
s to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readByteArray(java.io.DataInput)
-
writeByteArray
public static void writeByteArray(byte[] array, int len, java.io.DataOutput out) throws java.io.IOException
Writes the firstlen
elements of an array ofbyte
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofbyte
s to writelen
- the actual number of entries to write. If len is greater than then length of theout
- theDataOutput
to write to array then the entire array is written.- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readByteArray(java.io.DataInput)
-
writeObjectAsByteArray
public static void writeObjectAsByteArray(java.lang.Object obj, java.io.DataOutput out) throws java.io.IOException
Serialize the given objectobj
into a byte array usingwriteObject(Object, DataOutput)
and then writes the byte array to the given data outputout
in the same formatwriteByteArray(byte[], DataOutput)
does. This method will serialize anull
obj and not throw aNullPointerException
.- Parameters:
obj
- the object to serialize and writeout
- the data output to write the byte array to- Throws:
java.lang.IllegalArgumentException
- if a problem occurs while serializeobj
java.io.IOException
- if a problem occurs while writing toout
- Since:
- GemFire 5.0.2
- See Also:
readByteArray(java.io.DataInput)
-
readByteArray
public static byte[] readByteArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofbyte
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
byte
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeByteArray(byte[], DataOutput)
-
writeStringArray
public static void writeStringArray(java.lang.String[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofString
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofString
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readStringArray(java.io.DataInput)
,writeString(java.lang.String, java.io.DataOutput)
-
readStringArray
public static java.lang.String[] readStringArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofString
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
String
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeStringArray(java.lang.String[], java.io.DataOutput)
-
writeShortArray
public static void writeShortArray(short[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofshort
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofshort
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readShortArray(java.io.DataInput)
-
readShortArray
public static short[] readShortArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofshort
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
short
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeShortArray(short[], java.io.DataOutput)
-
writeCharArray
public static void writeCharArray(char[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofchar
s to aDataOutput
.- Parameters:
array
- the array ofchar
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readCharArray(java.io.DataInput)
-
readCharArray
public static char[] readCharArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofchar
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
char
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.7
- See Also:
writeCharArray(char[], java.io.DataOutput)
-
writeBooleanArray
public static void writeBooleanArray(boolean[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofboolean
s to aDataOutput
.- Parameters:
array
- the array ofboolean
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readBooleanArray(java.io.DataInput)
-
readBooleanArray
public static boolean[] readBooleanArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofboolean
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
boolean
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- Since:
- GemFire 5.7
- See Also:
writeBooleanArray(boolean[], java.io.DataOutput)
-
writeIntArray
public static void writeIntArray(int[] array, java.io.DataOutput out) throws java.io.IOException
Writes anint
array to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofint
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readIntArray(java.io.DataInput)
-
readIntArray
public static int[] readIntArray(java.io.DataInput in) throws java.io.IOException
Reads anint
array from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
int
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeIntArray(int[], java.io.DataOutput)
-
writeLongArray
public static void writeLongArray(long[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array oflong
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array oflong
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readLongArray(java.io.DataInput)
-
readLongArray
public static long[] readLongArray(java.io.DataInput in) throws java.io.IOException
Reads an array oflong
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
long
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeLongArray(long[], java.io.DataOutput)
-
writeFloatArray
public static void writeFloatArray(float[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array offloat
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array offloat
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readFloatArray(java.io.DataInput)
-
readFloatArray
public static float[] readFloatArray(java.io.DataInput in) throws java.io.IOException
Reads an array offloat
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
float
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeFloatArray(float[], java.io.DataOutput)
-
writeDoubleArray
public static void writeDoubleArray(double[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofdouble
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofdouble
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readDoubleArray(java.io.DataInput)
-
readDoubleArray
public static double[] readDoubleArray(java.io.DataInput in) throws java.io.IOException
Reads an array ofdouble
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
double
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
- See Also:
writeDoubleArray(double[], java.io.DataOutput)
-
writeObjectArray
public static void writeObjectArray(java.lang.Object[] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofObject
s to aDataOutput
. This method will serialize anull
array and not throw aNullPointerException
.- Parameters:
array
- the array ofObject
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readObjectArray(java.io.DataInput)
,writeObject(Object, DataOutput)
-
readObjectArray
public static java.lang.Object[] readObjectArray(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads an array ofObject
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
Object
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- if the class of one of the array's elements cannot be found.- See Also:
writeObjectArray(java.lang.Object[], java.io.DataOutput)
,readObject(java.io.DataInput)
-
writeArrayOfByteArrays
public static void writeArrayOfByteArrays(byte[][] array, java.io.DataOutput out) throws java.io.IOException
Writes an array ofbyte[]
to aDataOutput
.- Parameters:
array
- the array ofbyte[]
s to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
.
-
readArrayOfByteArrays
public static byte[][] readArrayOfByteArrays(java.io.DataInput in) throws java.io.IOException
Reads an array ofbyte[]
s from aDataInput
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized array of
byte[]
s - Throws:
java.io.IOException
- A problem occurs while reading fromin
-
writeArrayList
public static void writeArrayList(java.util.ArrayList<?> list, java.io.DataOutput out) throws java.io.IOException
Writes anArrayList
to aDataOutput
. Note that even thoughlist
may be an instance of a subclass ofArrayList
,readArrayList
will always return an instance ofArrayList
, not an instance of the subclass. To preserve the class type oflist
,writeObject(Object, DataOutput)
should be used for data serialization. This method will serialize anull
list and not throw aNullPointerException
.- Parameters:
list
- theArrayList
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readArrayList(java.io.DataInput)
-
readArrayList
public static <E> java.util.ArrayList<E> readArrayList(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads anArrayList
from aDataInput
.- Type Parameters:
E
- – the type of elements in the list- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
ArrayList
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theArrayList
's elements cannot be found.- See Also:
writeArrayList(java.util.ArrayList<?>, java.io.DataOutput)
-
writeVector
public static void writeVector(java.util.Vector<?> list, java.io.DataOutput out) throws java.io.IOException
Writes anVector
to aDataOutput
. Note that even thoughlist
may be an instance of a subclass ofVector
,readVector
will always return an instance ofVector
, not an instance of the subclass. To preserve the class type oflist
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
list
- theVector
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readVector(java.io.DataInput)
-
readVector
public static <E> java.util.Vector<E> readVector(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads anVector
from aDataInput
.- Type Parameters:
E
- – the type of elements in the vector- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Vector
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theVector
's elements cannot be found.- Since:
- GemFire 5.7
- See Also:
writeVector(java.util.Vector<?>, java.io.DataOutput)
-
writeStack
public static void writeStack(java.util.Stack<?> list, java.io.DataOutput out) throws java.io.IOException
Writes anStack
to aDataOutput
. Note that even thoughlist
may be an instance of a subclass ofStack
,readStack
will always return an instance ofStack
, not an instance of the subclass. To preserve the class type oflist
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
list
- theStack
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readStack(java.io.DataInput)
-
readStack
public static <E> java.util.Stack<E> readStack(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads anStack
from aDataInput
.- Type Parameters:
E
- – the type of elements in the stack- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Stack
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theStack
's elements cannot be found.- Since:
- GemFire 5.7
- See Also:
writeStack(java.util.Stack<?>, java.io.DataOutput)
-
writeLinkedList
public static void writeLinkedList(java.util.LinkedList<?> list, java.io.DataOutput out) throws java.io.IOException
Writes anLinkedList
to aDataOutput
. Note that even thoughlist
may be an instance of a subclass ofLinkedList
,readLinkedList
will always return an instance ofLinkedList
, not an instance of the subclass. To preserve the class type oflist
,writeObject(Object, DataOutput)
should be used for data serialization. This method will serialize anull
list and not throw aNullPointerException
.- Parameters:
list
- theLinkedList
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readLinkedList(java.io.DataInput)
-
readLinkedList
public static <E> java.util.LinkedList<E> readLinkedList(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads anLinkedList
from aDataInput
.- Type Parameters:
E
- – the type of elements in the list- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
LinkedList
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theLinkedList
's elements cannot be found.- See Also:
writeLinkedList(java.util.LinkedList<?>, java.io.DataOutput)
-
writeHashSet
public static void writeHashSet(java.util.HashSet<?> set, java.io.DataOutput out) throws java.io.IOException
Writes aHashSet
to aDataOutput
. Note that even thoughset
may be an instance of a subclass ofHashSet
,readHashSet
will always return an instance ofHashSet
, not an instance of the subclass. To preserve the class type ofset
,writeObject(Object, DataOutput)
should be used for data serialization. This method will serialize anull
set and not throw aNullPointerException
.- Parameters:
set
- theHashSet
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readHashSet(java.io.DataInput)
-
readHashSet
public static <E> java.util.HashSet<E> readHashSet(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aHashSet
from aDataInput
.- Type Parameters:
E
- – the type of elements in the set- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
HashSet
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theHashSet
's elements cannot be found.- See Also:
writeHashSet(java.util.HashSet<?>, java.io.DataOutput)
-
writeLinkedHashSet
public static void writeLinkedHashSet(java.util.LinkedHashSet<?> set, java.io.DataOutput out) throws java.io.IOException
Writes aLinkedHashSet
to aDataOutput
. Note that even thoughset
may be an instance of a subclass ofLinkedHashSet
,readLinkedHashSet
will always return an instance ofLinkedHashSet
, not an instance of the subclass. To preserve the class type ofset
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
set
- theLinkedHashSet
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readLinkedHashSet(java.io.DataInput)
-
readLinkedHashSet
public static <E> java.util.LinkedHashSet<E> readLinkedHashSet(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aLinkedHashSet
from aDataInput
.- Type Parameters:
E
- – the type of elements in the set- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
LinkedHashSet
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theLinkedHashSet
's elements cannot be found.- Since:
- GemFire 5.7
- See Also:
writeLinkedHashSet(java.util.LinkedHashSet<?>, java.io.DataOutput)
-
writeHashMap
public static void writeHashMap(java.util.Map<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aHashMap
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofHashMap
,readHashMap
will always return an instance ofHashMap
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization. This method will serialize anull
map and not throw aNullPointerException
.- Parameters:
map
- theHashMap
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readHashMap(java.io.DataInput)
-
readHashMap
public static <K,V> java.util.HashMap<K,V> readHashMap(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aHashMap
from aDataInput
.- Type Parameters:
K
- – the type of keys in the mapV
- – the type of mapped values- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
HashMap
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theHashMap
's elements cannot be found.- See Also:
writeHashMap(java.util.Map<?, ?>, java.io.DataOutput)
-
writeIdentityHashMap
public static void writeIdentityHashMap(java.util.IdentityHashMap<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aIdentityHashMap
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofIdentityHashMap
,readIdentityHashMap
will always return an instance ofIdentityHashMap
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
map
- theIdentityHashMap
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readIdentityHashMap(java.io.DataInput)
-
readIdentityHashMap
public static <K,V> java.util.IdentityHashMap<K,V> readIdentityHashMap(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aIdentityHashMap
from aDataInput
. Note that key identity is not preserved unless the keys belong to a class whose serialization preserves identity.- Type Parameters:
K
- – the type of keys in the mapV
- – the type of mapped values- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
IdentityHashMap
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theIdentityHashMap
's elements cannot be found.- See Also:
writeIdentityHashMap(java.util.IdentityHashMap<?, ?>, java.io.DataOutput)
-
writeConcurrentHashMap
public static void writeConcurrentHashMap(java.util.concurrent.ConcurrentHashMap<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aConcurrentHashMap
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofConcurrentHashMap
,readConcurrentHashMap
will always return an instance ofConcurrentHashMap
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization.At this time if
writeObject(Object, DataOutput)
is called with an instance of ConcurrentHashMap then it will be serialized with normal java.io Serialization. So if you want the keys and values of a ConcurrentHashMap to take advantage of GemFire serialization it must be serialized with this method.- Parameters:
map
- theConcurrentHashMap
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 6.6
- See Also:
readConcurrentHashMap(java.io.DataInput)
-
readConcurrentHashMap
public static <K,V> java.util.concurrent.ConcurrentHashMap<K,V> readConcurrentHashMap(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aConcurrentHashMap
from aDataInput
.- Type Parameters:
K
- – the type of keys in the mapV
- – the type of mapped values- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
ConcurrentHashMap
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theConcurrentHashMap
's elements cannot be found.- Since:
- GemFire 6.6
- See Also:
writeConcurrentHashMap(java.util.concurrent.ConcurrentHashMap<?, ?>, java.io.DataOutput)
-
writeHashtable
public static void writeHashtable(java.util.Hashtable<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aHashtable
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofHashtable
,readHashtable
will always return an instance ofHashtable
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
map
- theHashtable
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readHashtable(java.io.DataInput)
-
readHashtable
public static <K,V> java.util.Hashtable<K,V> readHashtable(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aHashtable
from aDataInput
.- Type Parameters:
K
- – the type of keys in the hashtableV
- – the type of values in the hashtable- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
Hashtable
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theHashtable
's elements cannot be found.- Since:
- GemFire 5.7
- See Also:
writeHashtable(java.util.Hashtable<?, ?>, java.io.DataOutput)
-
writeTreeMap
public static void writeTreeMap(java.util.TreeMap<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aTreeMap
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofTreeMap
,readTreeMap
will always return an instance ofTreeMap
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization.If the map has a comparator then it must also be serializable.
- Parameters:
map
- theTreeMap
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- Since:
- GemFire 5.7
- See Also:
readTreeMap(java.io.DataInput)
-
readTreeMap
public static <K,V> java.util.TreeMap<K,V> readTreeMap(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aTreeMap
from aDataInput
.- Type Parameters:
K
- – the type of keys in the mapV
- – the type of mapped values- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
TreeMap
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theTreeMap
's elements cannot be found.- Since:
- GemFire 5.7
- See Also:
writeTreeMap(java.util.TreeMap<?, ?>, java.io.DataOutput)
-
writeLinkedHashMap
public static void writeLinkedHashMap(java.util.Map<?,?> map, java.io.DataOutput out) throws java.io.IOException
Writes aLinkedHashMap
to aDataOutput
. Note that even thoughmap
may be an instance of a subclass ofLinkedHashMap
,readLinkedHashMap
will always return an instance ofLinkedHashMap
, not an instance of the subclass. To preserve the class type ofmap
,writeObject(Object, DataOutput)
should be used for data serialization. This method will serialize anull
map and not throw aNullPointerException
.- Parameters:
map
- theLinkedHashMap
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readLinkedHashMap(java.io.DataInput)
-
readLinkedHashMap
public static <K,V> java.util.LinkedHashMap<K,V> readLinkedHashMap(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aLinkedHashMap
from aDataInput
.- Type Parameters:
K
- – the type of keys in the mapV
- – the type of mapped values- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
LinkedHashMap
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theHashMap
's elements cannot be found.- See Also:
writeLinkedHashMap(java.util.Map<?, ?>, java.io.DataOutput)
-
writeTreeSet
public static void writeTreeSet(java.util.TreeSet<?> set, java.io.DataOutput out) throws java.io.IOException
Writes aTreeSet
to aDataOutput
. Note that even thoughset
may be an instance of a subclass ofTreeSet
,readTreeSet
will always return an instance ofTreeSet
, not an instance of the subclass. To preserve the class type ofset
,writeObject(Object, DataOutput)
should be used for data serialization.If the set has a comparator then it must also be serializable.
- Parameters:
set
- theTreeSet
to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readTreeSet(java.io.DataInput)
-
readTreeSet
public static <E> java.util.TreeSet<E> readTreeSet(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aTreeSet
from aDataInput
.- Type Parameters:
E
- the type contained in theTreeSet
- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized
TreeSet
- Throws:
java.io.IOException
- A problem occurs while reading fromin
java.lang.ClassNotFoundException
- The class of one of theTreeSet
's elements cannot be found.- See Also:
writeTreeSet(java.util.TreeSet<?>, java.io.DataOutput)
-
writeProperties
public static void writeProperties(java.util.Properties props, java.io.DataOutput out) throws java.io.IOException
Writes aProperties
to aDataOutput
.NOTE: The
defaults
of the specifiedprops
are not serialized.Note that even though
props
may be an instance of a subclass ofProperties
,readProperties
will always return an instance ofProperties
, not an instance of the subclass. To preserve the class type ofprops
,writeObject(Object, DataOutput)
should be used for data serialization.- Parameters:
props
- the Properties to writeout
- theDataInput
to write to- Throws:
java.io.IOException
- A problem occurs while writing toout
- See Also:
readProperties(java.io.DataInput)
-
readProperties
public static java.util.Properties readProperties(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads aProperties
from aDataInput
.NOTE: the
defaults
are always empty in the returnedProperties
.- Parameters:
in
- theDataInput
to read from- Returns:
- the deserialized Properties
- Throws:
java.io.IOException
- If this serializer cannot read an object fromin
.java.lang.ClassNotFoundException
- If the class cannot be loaded- See Also:
writeProperties(java.util.Properties, java.io.DataOutput)
-
writeObject
public static void writeObject(java.lang.Object o, java.io.DataOutput out, boolean allowJavaSerialization) throws java.io.IOException
Writes an arbitrary object to aDataOutput
. Ifo
is not an instance of a specially-handled standard Java class (see the list ingetSupportedClasses()
), thetoData
method of each registeredDataSerializer
is invoked until the object is serialized. If no registered serializer can serialize the object ando
does not implementDataSerializable
, then it is serialized toout
using standard Java serialization. This method will serialize anull
o and not throw aNullPointerException
.- Parameters:
o
- the object to writeout
- theDataOutput
to write toallowJavaSerialization
- If false, then a NotSerializableException is thrown in the case where standard Java serialization would otherwise be used for objecto
or for any nested subobject ofo
. This is used to prevent Java serialization from being used when sending data to a non-Java client- Throws:
java.io.IOException
- A problem occurs while writingo
toout
- See Also:
readObject(DataInput)
,Instantiator
,ObjectOutputStream.writeObject(java.lang.Object)
-
writeObject
public static void writeObject(java.lang.Object o, java.io.DataOutput out) throws java.io.IOException
Writes an arbitrary object to aDataOutput
. Ifo
is not an instance of a specially-handled standard Java class (such asDate
,Integer
, orArrayList
), thetoData
method of each registeredDataSerializer
is invoked until the object is serialized. If no registered serializer can serialize the object ando
does not implementDataSerializable
, then it is serialized toout
using standard Java serialization. This method will serialize anull
o and not throw aNullPointerException
.- Parameters:
o
- the object to writeout
- theDataOutput
to write to- Throws:
java.io.IOException
- A problem occurs while writingo
toout
- See Also:
readObject(DataInput)
,DataSerializer
,ObjectOutputStream.writeObject(java.lang.Object)
-
readObject
public static <T> T readObject(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads an arbitrary object from aDataInput
. Instances of classes that are not handled specially (such asString
,Class
, andDataSerializable
) are read using standard Java serialization.Note that if an object is deserialized using standard Java serialization, its class will be loaded using the current thread's
context class loader
before the one normally used by Java serialization is consulted.- Type Parameters:
T
- the type of the Object to read- Parameters:
in
- theDataInput
to read from- Returns:
- an arbitrary deserialized object
- Throws:
java.io.IOException
- A problem occurred while reading fromin
(may wrap another exception)java.lang.ClassNotFoundException
- The class of an object read fromin
could not be found- See Also:
writeObject(Object, DataOutput)
,ObjectInputStream.readObject()
-
register
public static DataSerializer register(java.lang.Class<?> c)
Registers aDataSerializer
class with the data serialization framework. This method uses reflection to create an instance of theDataSerializer
class by invoking its zero-argument constructor.The
DataSerializer
instance will be consulted by thewriteObject(Object, DataOutput)
andreadObject(java.io.DataInput)
methods. Note that no two serializers can support the same class.This method invokes the
DataSerializer
instance'sgetSupportedClasses()
method and keeps track of which classes can have their instances serialized by by this data serializer.- Parameters:
c
- theDataSerializer
class to create and register with the data serialization framework.- Returns:
- the registered serializer instance
- Throws:
java.lang.IllegalArgumentException
- Ifc
does not subclassDataSerializer
, ifc
does not have a zero-argument constructor, ifid
is 0, if getSupportedClasses returns null or an empty array, if getSupportedClasses returns and array with null elementsjava.lang.IllegalStateException
- if another serializer instance with idid
has already been registered, if another serializer instance that supports one of this instances classes has already been registered, if an attempt is made to support any of the classes reserved by DataSerializer (seegetSupportedClasses()
for a list).- See Also:
getSupportedClasses()
-
getSupportedClasses
public abstract java.lang.Class<?>[] getSupportedClasses()
Returns theClass
es whose instances are data serialized by thisDataSerializer
. This method is invoked when this serializer is registered. This method is not allowed to returnnull
nor an empty array. Only instances whose class name is the same as one of the class names in the result will be serialized by thisDataSerializer
. TwoDataSerializer
s are not allowed to support the same class. The following classes can not be supported by user defined data serializers since they are all supported by the predefined data serializer:Class
String
Boolean
Byte
Character
Short
Integer
Long
Float
Double
File
InetAddress
Inet4Address
Inet6Address
ArrayList
Date
HashMap
IdentityHashMap
HashSet
Hashtable
LinkedHashSet
LinkedList
Properties
TreeMap
TreeSet
Vector
any array class
- Returns:
- the
Class
es whose instances are data serialized by thisDataSerializer
-
toData
public abstract boolean toData(java.lang.Object o, java.io.DataOutput out) throws java.io.IOException
Data serializes an object to aDataOutput
. It is very important that when performing the "switch" ono
's class, your code test for a subclass before it tests for a superclass. Otherwise, the incorrect class id could be written to the serialization stream.- Parameters:
o
- The object to data serialize. It will never benull
.out
- theDataInput
to write to- Returns:
false
if thisDataSerializer
does not know how to data serializeo
.- Throws:
java.io.IOException
- If this serializer cannot write an object toout
.
-
fromData
public abstract java.lang.Object fromData(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Reads an object from aDataInput
. This implementation must support deserializing everything serialized by the matchingtoData(java.lang.Object, java.io.DataOutput)
.- Parameters:
in
- theDataInput
to write to- Returns:
- the deserialized Object
- Throws:
java.io.IOException
- If this serializer cannot read an object fromin
.java.lang.ClassNotFoundException
- If the class cannot be loaded- See Also:
toData(java.lang.Object, java.io.DataOutput)
-
getId
public abstract int getId()
Returns the id of thisDataSerializer
.Returns an int instead of a byte
- Returns:
- the id of this
DataSerializer
- Since:
- 5.7.
-
equals
public boolean equals(java.lang.Object o)
TwoDataSerializer
s are consider to be equal if they have the same id and the same class- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
setEventId
public void setEventId(java.lang.Object eventId)
For internal use only. Sets the uniqueeventId
of thisDataSerializer
.- Parameters:
eventId
- the uniqueeventId
of thisDataSerializer
- Since:
- GemFire 6.5
-
getEventId
public java.lang.Object getEventId()
For internal use only. Returns the uniqueeventId
of thisDataSerializer
.- Returns:
- the unique
eventId
of thisDataSerializer
- Since:
- GemFire 6.5
-
setContext
public void setContext(java.lang.Object context)
For internal use only. Sets the context of thisDataSerializer
.- Parameters:
context
- the context of thisDataSerializer
- Since:
- GemFire 6.5
-
getContext
public java.lang.Object getContext()
For internal use only. Returns the context of thisDataSerializer
.- Returns:
- the context of this
DataSerializer
- Since:
- GemFire 6.5
-
writeEnum
public static void writeEnum(java.lang.Enum<?> e, java.io.DataOutput out) throws java.io.IOException
Writes theEnum constant
toDataOutput
. Unlike standard java serialization which serializes both the enum name String and the ordinal, GemFire only serializes the ordinal byte, so for backward compatibility new enum constants should only be added to the end of the enum type.
Example:DataSerializer.writeEnum(DAY_OF_WEEK.SUN, out);
- Parameters:
e
- the Enum to serializeout
- theDataInput
to write to- Throws:
java.io.IOException
- if a problem occurs while writing toout
- Since:
- GemFire 6.5
- See Also:
readEnum(Class, DataInput)
-
readEnum
public static <E extends java.lang.Enum<E>> E readEnum(java.lang.Class<E> clazz, java.io.DataInput in) throws java.io.IOException
Reads aEnum constant
fromDataInput
. Unlike standard java serialization which serializes both the enum name String and the ordinal, GemFire only serializes the ordinal byte, so be careful about using the correct enum class. Also, for backward compatibility new enum constants should only be added to the end of the enum type.
Example:DAY_OF_WEEK d = DataSerializer.readEnum(DAY_OF_WEEK.class, in);
- Type Parameters:
E
- the type of Enum- Parameters:
clazz
- the Enum class to deserialize toin
- theDataInput
to read from- Returns:
- the deserialized Enum
- Throws:
java.io.IOException
- if a problem occurs while reading fromin
java.lang.ArrayIndexOutOfBoundsException
- if the wrong enum class/enum class with a different version and less enum constants is used- Since:
- GemFire 6.5
- See Also:
writeEnum(Enum, DataOutput)
-
-