Byte[] property type
One of the REST APIs we need to call takes one of request parameter as a byte array. I am trying to create a message class and couldnt figure out which is equivalent type that corresponds to Byte[]. I need to read from a jpg file and then convert it to byte[] before i invoke this webservice. Appreciate if anyone can point me in the right direction. I can use %Stream.FileBinary class to store the jpg file after loading from a file. trying to figure out how to convert that to byte[].
Thank you,
Ravi
Product version: IRIS 2019.1
$ZV: IRIS for UNIX (IBM AIX for System Power System-64) 2019.1 (Build 510_4_19056U) Fri Jun 28 2019 16:23:09 EDT
There is no explicit type Byte . In IRIS it's just an %Integer <256.
The equivalent to a byte[] array is a String of data type %Binary
To access the Byte values of the "array" use $A(your_binstring, position)
Attention: position starts with 1
Use any of the Binary streams:
To send a stream just fill
EntityBody
property of a request object by calling it'sCopyFrom
method.Thank you Eduard and Robert.
Do i have to encode this to base64 prior to the WS call?
Depends on what WS expects, really.