com.jguild.jrpm.io.datatype
Class TypeFactory

java.lang.Object
  extended bycom.jguild.jrpm.io.datatype.TypeFactory

public class TypeFactory
extends java.lang.Object

Factory to create rpm data types

Author:
kuss

Constructor Summary
TypeFactory()
           
 
Method Summary
static BIN createBIN(byte[] data)
           
static CHAR createCHAR(char[] data)
           
static DataTypeIf createFromStream(java.io.DataInputStream inputStream, IndexEntry indexEntry, long length)
          This method creates a rpm data type out of a input stream and an IndexEntry.
static I18NSTRING createI18NSTRING(java.lang.String[] str)
           
static INT16 createINT16(short[] data)
           
static INT32 createINT32(int[] data)
           
static INT64 createINT64(long[] data)
           
static INT8 createINT8(byte[] data)
           
static NULL createNULL(int size)
           
static STRING_ARRAY createSTRING_ARRAY(java.lang.String[] str)
           
static STRING createSTRING(java.lang.String str)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TypeFactory

public TypeFactory()
Method Detail

createBIN

public static BIN createBIN(byte[] data)

createCHAR

public static CHAR createCHAR(char[] data)

createI18NSTRING

public static I18NSTRING createI18NSTRING(java.lang.String[] str)

createINT8

public static INT8 createINT8(byte[] data)

createINT16

public static INT16 createINT16(short[] data)

createINT32

public static INT32 createINT32(int[] data)

createINT64

public static INT64 createINT64(long[] data)

createNULL

public static NULL createNULL(int size)

createSTRING

public static STRING createSTRING(java.lang.String str)

createSTRING_ARRAY

public static STRING_ARRAY createSTRING_ARRAY(java.lang.String[] str)

createFromStream

public static DataTypeIf createFromStream(java.io.DataInputStream inputStream,
                                          IndexEntry indexEntry,
                                          long length)
                                   throws java.io.IOException
This method creates a rpm data type out of a input stream and an IndexEntry. The object must at the current position of the input stream. The length is only needed for string objects; the string objects will read length bytes of the input stream and will try to convert the data into a rpm data type.

Parameters:
inputStream - The input stream
indexEntry - The IndexEntry that should be read
length - The number of bytes to read for string objects
Returns:
One of the rpm data types coresponding with the type contained in the IndexEntry.
Throws:
java.io.IOException - if something was wrong during reading of the input stream


Copyright © 2002-2005 Sourceforge. All Rights Reserved.