Class ObjectWriter

java.lang.Object
  |
  +--ObjectWriter

public class ObjectWriter
extends java.lang.Object

This class is used to write an object by converting it to a byte array and inturn converting that a string and reconstructing the object back from from the string representation


Constructor Summary
ObjectWriter()
           
 
Method Summary
 java.lang.Object bytesToObject(byte[] byteBuffer)
          Converts a ByteArray to an object
static void main(java.lang.String[] args)
           
 byte[] objectToBytes(java.lang.Object o)
          Converts an object to byte array.
 java.lang.String objectToString(java.lang.Object o)
          Converts an object to a string.
 java.lang.Object stringToObject(java.lang.String s)
          Converts a string to an object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObjectWriter

public ObjectWriter()
Method Detail

objectToString

public java.lang.String objectToString(java.lang.Object o)
Converts an object to a string.

Returns:
String String representation of the object

objectToBytes

public byte[] objectToBytes(java.lang.Object o)
Converts an object to byte array.

Returns:
ByteArray representation of the object

stringToObject

public java.lang.Object stringToObject(java.lang.String s)
Converts a string to an object

Returns:
Object Object that is reconstructed from its String representation

bytesToObject

public java.lang.Object bytesToObject(byte[] byteBuffer)
Converts a ByteArray to an object

Parameters:
byteBuffer - ByteArray to be converted to an object
Returns:
Object Object that is reconstructed from its byte array representation

main

public static void main(java.lang.String[] args)