Package org.jgroups.util
Class ObjectWrapperPrimitive
- java.lang.Object
-
- org.jgroups.util.ObjectWrapperPrimitive
-
- All Implemented Interfaces:
SizeStreamable
,Streamable
- Direct Known Subclasses:
ObjectWrapperSerializable
public class ObjectWrapperPrimitive extends java.lang.Object implements SizeStreamable
Wraps a primitive object (e.g. Integer, Boolean, byte[], String etc)- Since:
- 5.0.0
- Author:
- Bela Ban
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object
obj
-
Constructor Summary
Constructors Constructor Description ObjectWrapperPrimitive()
ObjectWrapperPrimitive(java.lang.Object obj)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getLength()
<T> T
getObject()
void
readFrom(java.io.DataInput in)
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closedint
serializedSize()
Returns the size (in bytes) of the marshalled objectObjectWrapperPrimitive
setObject(java.lang.Object obj)
java.lang.String
toString()
void
writeTo(java.io.DataOutput out)
Write the entire state of the current object (including superclasses) to outstream.
-
-
-
Method Detail
-
getObject
public <T> T getObject()
-
setObject
public ObjectWrapperPrimitive setObject(java.lang.Object obj)
-
getLength
public int getLength()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
serializedSize
public int serializedSize()
Description copied from interface:SizeStreamable
Returns the size (in bytes) of the marshalled object- Specified by:
serializedSize
in interfaceSizeStreamable
-
writeTo
public void writeTo(java.io.DataOutput out) throws java.io.IOException
Description copied from interface:Streamable
Write the entire state of the current object (including superclasses) to outstream. Note that the output stream must not be closed- Specified by:
writeTo
in interfaceStreamable
- Throws:
java.io.IOException
-
readFrom
public void readFrom(java.io.DataInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Description copied from interface:Streamable
Read the state of the current object (including superclasses) from instream Note that the input stream must not be closed- Specified by:
readFrom
in interfaceStreamable
- Throws:
java.io.IOException
java.lang.ClassNotFoundException
-
-