ariba.util.io
Class SerializeUtil

java.lang.Object
  extended by ariba.util.io.SerializeUtil

public class SerializeUtil
extends Object

Utilities useful for Serialization/Externalization.


Field Summary
static String ReadBoolean
          constant used by rpc stubgenerator to generate code to call the readBoolean method.
static String ReadChar
          constant used by rpc stubgenerator to generate code to call the readChar method.
static String ReadFloat
          constant used by rpc stubgenerator to generate code to call the readFloat method.
static String ReadInt
          constant used by rpc stubgenerator to generate code to call the readInt method.
static String ReadLocale
          constant used by rpc stubgenerator to generate code to call the readLocale method.
static String ReadLong
          constant used by rpc stubgenerator to generate code to call the readLong method.
static String ReadObject
          constant for calling the readObject method, used by rpc stubgenerator.
static String ReadUTF
          constant for calling the readUTF method, used by rpc stubgenerator.
static String ResetObjectTable
          Deprecated.  
static String WriteBoolean
          constant used by rpc stubgenerator to generate code to call the writeBoolean method.
static String WriteChar
          constant used by rpc stubgenerator to generate code to call the writeChar method.
static String WriteFloat
          constant used by rpc stubgenerator to generate code to call the writeFloat method.
static String WriteInt
          constant used by rpc stubgenerator to generate code to call the writeInt method.
static String WriteLocale
          constant used by rpc stubgenerator to generate code to call the writeLocale method.
static String WriteLong
          constant used by rpc stubgenerator to generate code to call the writeLong method.
static String WriteObject
          constant for calling the writeObject method, used by rpc stubgenerator.
static String WriteUTF
          constant for calling the writeUTF method, used by rpc stubgenerator.
 
Method Summary
static Locale readLocale(ObjectInput input)
          helper function to read the Locale object during serialization, read back the String from the given input stream.
static String readUTF(ObjectInput input)
          helper function to read a String during serialization.
static void writeLocale(ObjectOutput output, Locale locale)
          helper function to write the Locale object during serialization.
static void writeUTF(ObjectOutput output, String str)
          helper function to write a String during serialization.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WriteUTF

public static final String WriteUTF
constant for calling the writeUTF method, used by rpc stubgenerator.

See Also:
Constant Field Values

WriteObject

public static final String WriteObject
constant for calling the writeObject method, used by rpc stubgenerator.

See Also:
Constant Field Values

WriteInt

public static final String WriteInt
constant used by rpc stubgenerator to generate code to call the writeInt method.

See Also:
Constant Field Values

WriteBoolean

public static final String WriteBoolean
constant used by rpc stubgenerator to generate code to call the writeBoolean method.

See Also:
Constant Field Values

WriteLong

public static final String WriteLong
constant used by rpc stubgenerator to generate code to call the writeLong method.

See Also:
Constant Field Values

WriteFloat

public static final String WriteFloat
constant used by rpc stubgenerator to generate code to call the writeFloat method.

See Also:
Constant Field Values

WriteChar

public static final String WriteChar
constant used by rpc stubgenerator to generate code to call the writeChar method.

See Also:
Constant Field Values

WriteLocale

public static final String WriteLocale
constant used by rpc stubgenerator to generate code to call the writeLocale method.

See Also:
Constant Field Values

ResetObjectTable

public static final String ResetObjectTable
Deprecated. 
constant used by rpc stubgenerator to generate code to call the resetObjectTable method.

See Also:
Constant Field Values

ReadObject

public static final String ReadObject
constant for calling the readObject method, used by rpc stubgenerator.

See Also:
Constant Field Values

ReadUTF

public static final String ReadUTF
constant for calling the readUTF method, used by rpc stubgenerator.

See Also:
Constant Field Values

ReadInt

public static final String ReadInt
constant used by rpc stubgenerator to generate code to call the readInt method.

See Also:
Constant Field Values

ReadBoolean

public static final String ReadBoolean
constant used by rpc stubgenerator to generate code to call the readBoolean method.

See Also:
Constant Field Values

ReadChar

public static final String ReadChar
constant used by rpc stubgenerator to generate code to call the readChar method.

See Also:
Constant Field Values

ReadLong

public static final String ReadLong
constant used by rpc stubgenerator to generate code to call the readLong method.

See Also:
Constant Field Values

ReadFloat

public static final String ReadFloat
constant used by rpc stubgenerator to generate code to call the readFloat method.

See Also:
Constant Field Values

ReadLocale

public static final String ReadLocale
constant used by rpc stubgenerator to generate code to call the readLocale method.

See Also:
Constant Field Values
Method Detail

writeUTF

public static void writeUTF(ObjectOutput output,
                            String str)
                     throws IOException
helper function to write a String during serialization. We need this because java.io.writeUTF does not accept a null object. So this is a wrapper to handle the null object. Used in conjuction with SerializeUtil.readUTF

Parameters:
output - the object output stream to write the String. Cannot be null.
str - the String object to serialize.
Throws:
IOException - I/O error occurred while writing to output
See Also:
readUTF(java.io.ObjectInput)

readUTF

public static String readUTF(ObjectInput input)
                      throws IOException
helper function to read a String during serialization. We need this because java.io.writeUTF does not accept a null object. So this is a wrapper to handle the null object. Used in conjuction with SerializeUtil.writeUTF

Parameters:
input - the object input stream to read the String. Cannot be null.
Returns:
the String read.
Throws:
IOException - I/O error occurred while reading from input

writeLocale

public static void writeLocale(ObjectOutput output,
                               Locale locale)
                        throws IOException
helper function to write the Locale object during serialization. Actually, only the String returned by the Locale.toString method is serialized.

Parameters:
output - the ObjectOutput stream to write out the Locale object. Cannot be null.
locale - the Locale object to write, okay to be null.
Throws:
IOException - throws IOException if the write fails.
See Also:
readLocale(java.io.ObjectInput)

readLocale

public static Locale readLocale(ObjectInput input)
                         throws IOException
helper function to read the Locale object during serialization, read back the String from the given input stream.

Parameters:
input - the ObjectInput stream to read from, cannot be null.
Returns:
the Locale object corresponding to the String read.
Throws:
IOException - throws IOException if the read fails.
See Also:
writeLocale(java.io.ObjectOutput, java.util.Locale)


AribaWeb User Interface Development Framework
Copyright © 2000-2009 Ariba, Inc. All Rights Reserved.