Package com.mckoi.database.global
Class ObjectTransfer
- java.lang.Object
-
- com.mckoi.database.global.ObjectTransfer
-
public class ObjectTransfer extends java.lang.ObjectProvides static methods for transfering different types of objects over a Data input/output stream.- Author:
- Tobias Downer
-
-
Constructor Summary
Constructors Constructor Description ObjectTransfer()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static intexactSize(java.lang.Object ob)Returns the exact size an object will take up when serialized.static java.lang.ObjectreadFrom(java.io.DataInputStream in)Writes an object from the data input stream.static intsize(java.lang.Object ob)Makes an estimate of the size of the object.static voidwriteTo(java.io.DataOutput out, java.lang.Object ob)Writes an object to the data output stream.
-
-
-
Method Detail
-
size
public static int size(java.lang.Object ob) throws java.io.IOExceptionMakes an estimate of the size of the object. This is useful for making a guess for how much this will take up.- Throws:
java.io.IOException
-
exactSize
public static int exactSize(java.lang.Object ob) throws java.io.IOExceptionReturns the exact size an object will take up when serialized.- Throws:
java.io.IOException
-
writeTo
public static void writeTo(java.io.DataOutput out, java.lang.Object ob) throws java.io.IOExceptionWrites an object to the data output stream.- Throws:
java.io.IOException
-
readFrom
public static java.lang.Object readFrom(java.io.DataInputStream in) throws java.io.IOExceptionWrites an object from the data input stream.- Throws:
java.io.IOException
-
-