Open topic with navigation

TIBCO Rendezvous® 8.7.0

# TibrvMsg.setHandlers()

Method

## Declaration

    static void setHandlers(
        short              userType,
        TibrvMsgEncoder    encoder,
        TibrvMsgDecoder    decoder)

## Purpose

Define a custom datatype by registering its encoder and decoder interfaces.

## Remarks

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

This method sets (or replaces) both interfaces. Supplying `null` for either the encoder or the decoder, removes that interface. Supplying `null` for both interfaces disables the custom type (by removing both interfaces).

Parameter | Description
`userType` | Define a custom datatype with this numeric designator. This type designator must be in the inclusive range `[TibrvMsg.USER_FIRST,TibrvMsg.USER_LAST].`
`encoder` | Register this encoder for the type.
`decoder` | Register this decoder for the type.

## See Also

TibrvMsgDecoder

TibrvMsgEncoder

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.