# tibemsBytesMsg_Read

Function

## Purpose

Read primitive datatypes from the byte stream in the message body.

## C Declaration

    tibems_status tibemsBytesMsg_ReadBoolean(
        tibemsBytesMsg message,
        tibems_bool* value );

    tibems_status tibemsBytesMsg_ReadByte(
        tibemsBytesMsg message,
        tibems_byte* value );

    tibems_status tibemsBytesMsg_ReadChar(
        tibemsBytesMsg message,
        tibems_wchar* value );

    tibems_status tibemsBytesMsg_ReadDouble(
        tibemsBytesMsg message,
        tibems_double* value );

    tibems_status tibemsBytesMsg_ReadFloat(
        tibemsBytesMsg message,
        tibems_float* value );

    tibems_status tibemsBytesMsg_ReadInt(
        tibemsBytesMsg message,
        tibems_int* value );

    tibems_status tibemsBytesMsg_ReadLong(
        tibemsBytesMsg message,
        tibems_long* value );

    tibems_status tibemsBytesMsg_ReadShort(
        tibemsBytesMsg message,
        tibems_short* value );

    tibems_status tibemsBytesMsg_ReadUnsignedByte(
        tibemsBytesMsg message,
        tibems_int* value );

    tibems_status tibemsBytesMsg_ReadUnsignedShort(
        tibemsBytesMsg message,
        tibems_int* value );

## COBOL Call

    CALL "tibemsBytesMsg_ReadBoolean"
     USING BY VALUE message,
           BY REFERENCE  tibems-Boolean,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadByte"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadChar"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadDouble"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadFloat"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadInt"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadLong"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadShort"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadUnsignedByte"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

    CALL "tibemsBytesMsg_ReadUnsignedShort"
     USING BY VALUE message,
           BY REFERENCE value,
           RETURNING tibems-status
    END-CALL.

Note: `message` has usage pointer in all calls.

## Parameters

Parameter | Description
--- | ---
`message` | Read a datum from the body byte stream of this message.
`value` | Store the datum.

## Remarks

The JMS specification defines eleven calls to extract data from the byte stream body of a `tibemsBytesMsg`. Each call reads a unit of data from the stream, and advances the read position so that the next read call gets the next datum.

Function | # Bytes | Interpret As
--- | --- | ---
`tibemsBytesMsg_ReadBoolean` | 1 | `tibems_bool`
`tibemsBytesMsg_ReadByte` | 1 | `tibems_byte`
`tibemsBytesMsg_ReadUnsignedByte` | 1 | `tibems_int`
`tibemsBytesMsg_ReadShort` | 2 | `tibems_short`
`tibemsBytesMsg_ReadUnsignedShort` | 2 | `tibems_int`
`tibemsBytesMsg_ReadChar` | 2 | `tibems_wchar`
`tibemsBytesMsg_ReadInt` | 4 | `tibems_int`
`tibemsBytesMsg_ReadLong` | 8 | `tibems_long`
`tibemsBytesMsg_ReadFloat` | 4 | `tibems_float`
`tibemsBytesMsg_ReadDouble` | 8 | `tibems_double`
`tibemsBytesMsg_ReadUTF` | varies | `char*` Encoded as UTF.

## See Also

`tibemsBytesMsg_ReadBytes`

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