Extract an array of two-byte signed integers from this stream.
Declared in <bslx_genericinstream.h>
GenericInStream<STREAMBUF>&
getArrayInt16(
short* variables,
int numVariables);
Assign to the specified variables the consecutive two-byte, two's complement integers (in host byte order) comprised of each of the specified numVariables two-byte sequences of this stream at the current cursor location (in network byte order), update the cursor location, and return a reference to this stream. If this stream is initially invalid, this operation has no effect. If this function otherwise fails to extract a valid value, this stream is marked invalid and the value of variables is undefined. The behavior is undefined unless 0 <= numVariables and variables has sufficient capacity, or 0 == numVariables && nullptr == variables. Note that each of the values will be sign-extended.
a reference to this stream
| Name | Description |
|---|---|
| variables | destination array for the extracted values |
| numVariables | number of two-byte integers to extract |