at.spardat.xma.serializer
Interface XmaOutput

All Known Subinterfaces:
Serializer
All Known Implementing Classes:
AsciiSerializer, BinarySerializer

public interface XmaOutput

This interface provides for transforming various java primitive types to a destination format that is dependent on the class implementing this interface.


Method Summary
 boolean isAtServer()
          Indicates that this is executing at the server
 void writeBoolean(java.lang.String label, boolean b)
          Writes a boolean
 void writeByte(java.lang.String label, int b)
          Write a byte
 void writeInt(java.lang.String label, int i)
          Writes an int
 void writeLong(java.lang.String label, long l)
          Writes a long
 void writeObject(java.lang.String label, java.lang.Object obj)
          Writes an Object.
 void writeSerializedBytes(java.lang.String label, byte[] bytes)
          Write a sequence of bytes that is the output of the same kind of Serializer that is active now, i.e., providing this XmaOutput.
 void writeShort(java.lang.String label, int s)
          Writes a short
 void writeString(java.lang.String label, java.lang.String s)
          Outputs a String
 void writeStringN(java.lang.String label, java.lang.String s)
          Same as writeString, except that s may be null;
 

Method Detail

writeString

public void writeString(java.lang.String label,
                        java.lang.String s)
                 throws java.io.IOException
Outputs a String

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
s - the String; must not be null
Throws:
java.lang.NullPointerException - if s is null
java.io.IOException

writeStringN

public void writeStringN(java.lang.String label,
                         java.lang.String s)
                  throws java.io.IOException
Same as writeString, except that s may be null;

Throws:
java.io.IOException

writeInt

public void writeInt(java.lang.String label,
                     int i)
              throws java.io.IOException
Writes an int

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
i - the int
Throws:
java.io.IOException

writeLong

public void writeLong(java.lang.String label,
                      long l)
               throws java.io.IOException
Writes a long

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
l - the long
Throws:
java.io.IOException

writeShort

public void writeShort(java.lang.String label,
                       int s)
                throws java.io.IOException
Writes a short

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
s - the short
Throws:
java.io.IOException

writeBoolean

public void writeBoolean(java.lang.String label,
                         boolean b)
                  throws java.io.IOException
Writes a boolean

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
b - the boolean
Throws:
java.io.IOException

writeByte

public void writeByte(java.lang.String label,
                      int b)
               throws java.io.IOException
Write a byte

Parameters:
label - short string that describes what the second parameter means; this string has only descriptive purpose.
b - the byte
Throws:
java.io.IOException

writeSerializedBytes

public void writeSerializedBytes(java.lang.String label,
                                 byte[] bytes)
                          throws java.io.IOException
Write a sequence of bytes that is the output of the same kind of Serializer that is active now, i.e., providing this XmaOutput.

Parameters:
bytes - sequence of bytes; must not be null
Throws:
java.io.IOException

writeObject

public void writeObject(java.lang.String label,
                        java.lang.Object obj)
                 throws java.io.IOException
Writes an Object. Depending on the Serializer implementing XmaOutput, obj needs to implement further interfaces, i.e., java.io.Serializable for binary format.

Parameters:
obj - the object to serialize; must not be null
Throws:
java.io.IOException

isAtServer

public boolean isAtServer()
Indicates that this is executing at the server