Open topic with navigation

TIBCO Rendezvous® 8.7.0

# ICustomDataTypeAdapter

Interface

## Visual Basic

    Public Interface ICustomDataTypeAdapter

## C#

    public interface ICustomDataTypeAdapter

## Purpose

Interface for encoding and decoding custom datatypes.

Member | Description |
## Public Instance Properties
``TypeID`` | ``byte`` Each adapter class must return the type designator corresponding to the type that it encodes and decodes. Type designators of custom datatypes must be in this inclusive range (the range constants are public static fields of Message):
      [MinimumCustomDataTypeIDMaximumCustomDataTypeID, MinimumCustomDataTypeIDMaximumCustomDataTypeID]
Type designators must be consistent across all senders and receivers within a network environment. | Get

Method | Description | Page
`ICustomDataTypeAdapter.Decode()` | Decode a byte array to produce a custom datatype. | ICustomDataTypeAdapter.Decode()
`ICustomDataTypeAdapter.Encode()` | Encode a custom datatype instance to produce a byte array. | ICustomDataTypeAdapter.Encode()

## Remarks

Programs must implement this interface to automatically convert between custom datatypes and Rendezvous wire format.

To define a custom datatype, a program must do three steps:

Procedure

| 1. | Define the datatype class, indicating that it implements ICustomDataType.

| 2. | Define an adapter that implements this ICustomDataTypeAdapter interface—including the TypeID property, and `Decode` and `Encode` methods.

The encoder and decoder must implement inverse operators. That is, when the encoder encodes a .NET object as a byte array, the decoder must decode the byte array to an identical .NET object. Conversely, when the decoder decodes the byte array to a .NET object, the encoder must encode the .NET object as an identical byte array.

| 3. | Register the pairing of datatype and adapter.

## See Also

Message.RegisterCustomDataType

ICustomDataType

Subtopics

Did you find this helpful?

Yes No
Great!
Thanks for taking the time to give us some feedback.
Sorry about that

Why wasn't this helpful? (check all that apply)

Could not find what I was looking for
Instructions confusing or unclear
Instructions did not work

Want to tell us more?

Please select at least one option or provide details about the issue!!

Error occurred while submitting feedback.

Error2 occurred while submitting feedback.

TIBCO Rendezvous®

Copyright © 1997-2023. Cloud Software Group, Inc. All Rights Reserved.