Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## oracle.jbo.common
Class TypeMarshaller

    java.lang.Object
      |
      +--oracle.jbo.common.TypeMarshaller

public class TypeMarshaller
extends java.lang.Object

Provides methods for passing primitive Java values between the client and middle tier as byte streams.

Since:
  Jdeveloper 3.0

Constructor Summary
`TypeMarshaller()`

Method Summary
`static byte[]` | `createStream(boolean val)` Serializes a Java boolean value.
`static byte[]` | `createStream(byte val)` Serializes an 8-bit Java integer value.
`static byte[]` | `createStream(char val)` Serializes a Java character.
`static byte[]` | `createStream(java.lang.Class cls, java.lang.Object obj)` Serializes a Java object of a specified class.
`static byte[]` | `createStream(double val)` Serializes a 64-bit Java floating-point value.
`static byte[]` | `createStream(float val)` Serializes a 32-bit Java floating-point value.
`static byte[]` | `createStream(int val)` Serializes a 32-bit Java integer value.
`static byte[]` | `createStream(long val)` Serializes a 64-bit Java integer value.
`static byte[]` | `createStream(short val)` Serializes a 16-bit Java integer value.
`static boolean` | `readBoolean(byte[] byteStream)` Reads a boolean value from a byte stream.
`static byte` | `readByte(byte[] byteStream)` Reads an 8-bit Java integer from a byte stream.
`static char` | `readChar(byte[] byteStream)` Reads a Java character from a byte stream.
`static double` | `readDouble(byte[] byteStream)` Reads a 64-bit Java floating-point number from a byte stream.
`static float` | `readFloat(byte[] byteStream)` Reads a 32-bit Java floating-point number from a byte stream.
`static int` | `readInt(byte[] byteStream)` Reads a 32-bit Java integer from a byte stream.
`static long` | `readLong(byte[] byteStream)` Reads a 64-bit Java integer from a byte stream.
`static java.lang.Object` | `readObject(java.lang.Class cls, byte[] stream)` Reads a Java object of a specified class from a byte stream.
`static short` | `readShort(byte[] byteStream)` Reads a 16-bit Java integer from a byte stream.
`static java.lang.String` | `readString(byte[] byteStream)` Reads a Java string from a byte stream.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TypeMarshaller

    public TypeMarshaller()

Method Detail

### createStream

    public static final byte[] createStream(java.lang.Class cls,
                                            java.lang.Object obj)
                                     throws DataCreationException

  Serializes a Java object of a specified class.

  Parameters:
    `cls` - a Java primitive type.
    `obj` - n instance of `cls`.
  Returns:
    a byte stream.
  Throws:
    DataCreationException - if `obj` cannot be serialized.

### readObject

    public static final java.lang.Object readObject(java.lang.Class cls,
                                                    byte[] stream)
                                             throws DataCreationException

  Reads a Java object of a specified class from a byte stream.

  Parameters:
    `cls` - a Java primitive type.
    `stream` - serialized data.
  Returns:
    an instance of `cls`.
  Throws:
    DataCreationException - if the stream does not contain an object of the expected class.

### createStream

    public static final byte[] createStream(int val)
                                     throws DataCreationException

  Serializes a 32-bit Java integer value.

  Parameters:
    `val` - a 32-bit Java integer value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(short val)
                                     throws DataCreationException

  Serializes a 16-bit Java integer value.

  Parameters:
    `val` - a 16-bit Java integer value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(long val)
                                     throws DataCreationException

  Serializes a 64-bit Java integer value.

  Parameters:
    `val` - a 64-bit Java integer value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(float val)
                                     throws DataCreationException

  Serializes a 32-bit Java floating-point value.

  Parameters:
    `val` - a 32-bit Java floating-point value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(double val)
                                     throws DataCreationException

  Serializes a 64-bit Java floating-point value.

  Parameters:
    `val` - a 64-bit Java floating-point value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(byte val)
                                     throws DataCreationException

  Serializes an 8-bit Java integer value.

  Parameters:
    `val` - an 8-bit Java integer value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(boolean val)
                                     throws DataCreationException

  Serializes a Java boolean value.

  Parameters:
    `val` - a Java boolean value.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### createStream

    public static final byte[] createStream(char val)
                                     throws DataCreationException

  Serializes a Java character.

  Parameters:
    `val` - a Java character.
  Returns:
    a byte stream.
  Throws:
    DataCreationException -

### readString

    public static final java.lang.String readString(byte[] byteStream)
                                             throws DataCreationException

  Reads a Java string from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a Java string.
  Throws:
    DataCreationException -

### readInt

    public static final int readInt(byte[] byteStream)
                             throws DataCreationException

  Reads a 32-bit Java integer from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a 32-bit Java integer.
  Throws:
    DataCreationException -

### readShort

    public static final short readShort(byte[] byteStream)
                                 throws DataCreationException

  Reads a 16-bit Java integer from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a 16-bit Java integer.
  Throws:
    DataCreationException -

### readLong

    public static final long readLong(byte[] byteStream)
                               throws DataCreationException

  Reads a 64-bit Java integer from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a 64-bit Java integer.
  Throws:
    DataCreationException -

### readFloat

    public static final float readFloat(byte[] byteStream)
                                 throws DataCreationException

  Reads a 32-bit Java floating-point number from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a 32-bit Java floating-point number.
  Throws:
    DataCreationException -

### readDouble

    public static final double readDouble(byte[] byteStream)
                                   throws DataCreationException

  Reads a 64-bit Java floating-point number from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a 64-bit Java floating-point number.
  Throws:
    DataCreationException -

### readByte

    public static final byte readByte(byte[] byteStream)
                               throws DataCreationException

  Reads an 8-bit Java integer from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    an 8-bit Java integer.
  Throws:
    DataCreationException -

### readBoolean

    public static final boolean readBoolean(byte[] byteStream)
                                     throws DataCreationException

  Reads a boolean value from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a boolean value.
  Throws:
    DataCreationException -

### readChar

    public static final char readChar(byte[] byteStream)
                               throws DataCreationException

  Reads a Java character from a byte stream.

  Parameters:
    `byteStream` - serialized data.
  Returns:
    a Java character.
  Throws:
    DataCreationException -

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Business Components
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD