Package com.mckoi.database.global
Class ObjectTransfer
java.lang.Object
com.mckoi.database.global.ObjectTransfer
Provides static methods for transfering different types of objects over
a Data input/output stream.
- Author:
- Tobias Downer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic int
Returns the exact size an object will take up when serialized.static Object
Writes an object from the data input stream.static int
Makes an estimate of the size of the object.static void
writeTo
(DataOutput out, Object ob) Writes an object to the data output stream.
-
Constructor Details
-
ObjectTransfer
public ObjectTransfer()
-
-
Method Details
-
size
Makes an estimate of the size of the object. This is useful for making a guess for how much this will take up.- Throws:
IOException
-
exactSize
Returns the exact size an object will take up when serialized.- Throws:
IOException
-
writeTo
Writes an object to the data output stream.- Throws:
IOException
-
readFrom
Writes an object from the data input stream.- Throws:
IOException
-