# tibemsStreamMsg_ReadBytes

Function

## Purpose

Read a byte array from a stream message.

## C Declaration

    tibems_status tibemsStreamMsg_ReadBytes(
        tibemsStreamMsg message,
        void** value,
        tibems_uint* length );

## COBOL Call

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

Note: `message` and `value` have usage pointer.

## Parameters

Parameter | Description
--- | ---
`message` | Read a byte array from this message.
`value` | Store a pointer to the byte sequence (within the message).
`length` | Store the actual number of bytes read.

## Remarks

Each call reads bytes from the stream into the byte array, and advances the read position so that the next read call gets the next datum. (Other read functions are documented on separate pages.)

This call uses the length parameter to return the actual number of bytes read. When the call cannot read even one byte, the `length` is -1.

A program that calls this function must call it repeatedly until it returns -1, indicating that the program has extracted the complete set of bytes. Only then may the program call another read function.

## See Also

`tibemsStreamMsg_Read`

`tibemsStreamMsg_ReadField`

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