Open topic with navigation

TIBCO Rendezvous® 8.8.0

# TibrvMsgEncoder.encode()

Method

## Declaration

    byte[] encode(
        short type,
        java.lang.Object data)

## Purpose

Encode a Java object as a wire format custom datatype.

## Remarks

Before calling this method, TibrvMsg first checks its applicability by calling TibrvMsgEncoder.canEncode(). Whenever TibrvMsgEncoder.canEncode() indicates that encoding is viable, this method must correctly encode the object.

When this method successfully encodes the data, it must return the encoding as a byte array; the byte array value can have length zero. When this method fails, it must return `null`.

Methods that call TibrvMsgEncoder.encode() incorporate its byte array value directly into a TibrvMsg object.

Parameter | Description
`type` | Encode the data as an instance of this custom datatype.
`data` | Encode this data.

## See Also

TibrvMsgDecoder.decode()

TibrvMsgEncoder.canEncode()

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-2025. Cloud Software Group, Inc. All Rights Reserved.