at.spardat.xma.serializer
Class BinaryDeserializer

java.lang.Object
  extended byat.spardat.xma.serializer.BinaryDeserializer
All Implemented Interfaces:
Deserializer, XmaInput

public class BinaryDeserializer
extends java.lang.Object
implements Deserializer

Deserializer implementation that uses the Java Serialization Mechanism


Field Summary
 java.io.ObjectInput objIn_
          the instance variable seen by objects implementing Synchronization.internalize.
 
Constructor Summary
BinaryDeserializer(byte[] data)
          Constructor
BinaryDeserializer(byte[] data, int length)
          Constructor
BinaryDeserializer(byte[] data, int offset, int length)
          Constructor
 
Method Summary
 boolean readBoolean()
          Reads a boolean
 byte readByte()
          Reads a byte
 int readInt()
          Reads an int
 long readLong()
          Reads a long
 java.lang.Object readObject()
          Reads an object written with XmaOutput.writeObject
 byte[] readSerializedBytes()
          Reads a sequence of bytes that has been written with writeSerializedBytes.
 short readShort()
          Reads a short
 java.lang.String readString()
          Reads a String
 java.lang.String readStringN()
          Reads a String
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objIn_

public java.io.ObjectInput objIn_
the instance variable seen by objects implementing Synchronization.internalize.

Constructor Detail

BinaryDeserializer

public BinaryDeserializer(byte[] data,
                          int length)
Constructor

Parameters:
data - serialized array of data
length - first length bytes in data are used.

BinaryDeserializer

public BinaryDeserializer(byte[] data)
Constructor

Parameters:
data - serialized array of data

BinaryDeserializer

public BinaryDeserializer(byte[] data,
                          int offset,
                          int length)
Constructor

Parameters:
data - input array
offset - offset in the array where data starts
length - number of bytes
Method Detail

readString

public java.lang.String readString()
                            throws java.io.IOException
Description copied from interface: XmaInput
Reads a String

Specified by:
readString in interface XmaInput
Returns:
String never null
Throws:
java.io.IOException
See Also:
XmaInput.readString()

readStringN

public java.lang.String readStringN()
                             throws java.io.IOException
Description copied from interface: XmaInput
Reads a String

Specified by:
readStringN in interface XmaInput
Returns:
String that may be null
Throws:
java.io.IOException
See Also:
XmaInput.readStringN()

readInt

public int readInt()
            throws java.io.IOException
Description copied from interface: XmaInput
Reads an int

Specified by:
readInt in interface XmaInput
Returns:
int read
Throws:
java.io.IOException
See Also:
XmaInput.readInt()

readLong

public long readLong()
              throws java.io.IOException
Description copied from interface: XmaInput
Reads a long

Specified by:
readLong in interface XmaInput
Returns:
the read long
Throws:
java.io.IOException
See Also:
XmaInput.readLong()

readShort

public short readShort()
                throws java.io.IOException
Description copied from interface: XmaInput
Reads a short

Specified by:
readShort in interface XmaInput
Returns:
short read
Throws:
java.io.IOException
See Also:
XmaInput.readShort()

readBoolean

public boolean readBoolean()
                    throws java.io.IOException
Description copied from interface: XmaInput
Reads a boolean

Specified by:
readBoolean in interface XmaInput
Returns:
the boolean read
Throws:
java.io.IOException
See Also:
XmaInput.readBoolean()

readByte

public byte readByte()
              throws java.io.IOException
Description copied from interface: XmaInput
Reads a byte

Specified by:
readByte in interface XmaInput
Returns:
the byte read
Throws:
java.io.IOException
See Also:
XmaInput.readByte()

readSerializedBytes

public byte[] readSerializedBytes()
                           throws java.io.IOException
Description copied from interface: XmaInput
Reads a sequence of bytes that has been written with writeSerializedBytes. The result can be deserialized using the same kind of Deserializer as the one that provides this XmaInput.

Specified by:
readSerializedBytes in interface XmaInput
Throws:
java.io.IOException
See Also:
XmaInput.readSerializedBytes()

readObject

public java.lang.Object readObject()
                            throws java.lang.ClassNotFoundException,
                                   java.io.IOException
Description copied from interface: XmaInput
Reads an object written with XmaOutput.writeObject

Specified by:
readObject in interface XmaInput
Returns:
non-null object
Throws:
java.lang.ClassNotFoundException
java.io.IOException
See Also:
XmaInput.readObject()