MIDB
The MIDB function outputs the (left) N bytes specified by the Count property starting from the Xth byte specified by the Offset property.
Input/Output
Number of Connections: Min: 1/Max:3
| Input | Data Type | Description |
| Input1 | Binary | The data. |
| Input2 | Integer | Sets the Offset property. (optional) |
| Input3 | Integer | Sets the Count property. (optional) |
| Output | Data Type | Description |
| Output1 | Binary | The selected data. |
Property
| Name | Property Type | Description |
| Offset | int | The offset, in bytes, from the start of the input data from which byte data is selected. The first byte in the input data is "1". |
| Count | int | The number of bytes to select. |
Topic
- A value less than 1 entered in the Offset property will result in an error. The mapper component that this function is in will abort and throw an exception.
- A negative Count value results in the bytes to the left of the Offset being selected.
- If the value entered in the Count property is 0, or the Offset is greater than the number of bytes in the input data, zero bytes of data will be output.
- If the Offset + Count is greater than the number of bytes, all the bytes from the Offset to the end of the byte stream will be output.
How a Binary function handles byte conversions
The Binary Functions LEFTB, RIGHTB, MIDB, REPLACEB and TRUNCATEB handle input binary data as it is. If binary data cannot be successfully converted back to a string, an empty string is output.
Example
| Property | Output |
| Input1 | 0x6165696F75 | Offset | 2 | 0x6569 |
| | Count | 2 | |