# tibemsMsg_CreateFromBytes

Function

## Purpose

Create a message object from data in a byte sequence.

## C Declaration

    tibems_status tibemsMsg_CreateFromBytes(
        tibemsMsg* message,
        const void* bytes );

## COBOL Call

    CALL "tibemsMsg_CreateFromBytes"
         USING BY REFERENCE message,
               BY REFERENCE bytes,
               RETURNING tibems-status
    END-CALL.

Note: `message` has usage pointer.

## Parameters

Parameter | Description
--- | ---
`message` | Store a pointer to the new message.
`bytes` | Create a message from the data in this byte sequence. This data buffer represents the message in EMS wire format. To produce this type of buffer, use either `tibemsMsg_GetAsBytes` or `tibemsMsg_GetAsBytesCopy`.

## Remarks

Create a new message from a byte sequence and populates the message with data.

This function allocates the storage for the new message. Your program owns the messages that it creates, and must destroy those messages to reclaim the storage. That is, each call to this function must be paired with a call to `tibemsMsg_Destroy`.

The new message is independent of the original byte sequence. They do not share any storage.

The newly created message is read-only; to enable modification without erasing the content, call `tibemsMsg_MakeWriteable`.

## See Also

`tibemsMsg_Destroy`

`tibemsMsg_GetAsBytes`

`tibemsMsg_GetAsBytesCopy`

`tibemsMsg_MakeWriteable`

Copyright © Cloud Software Group, Inc. All rights reserved.