<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">All,<div><br></div><div>I'm trying to call a function in an external library which takes an array of structures as one of its parameters. I can see how to define a subclass of ExternalStructure, and how that creates convenient field accessors which read/write an underlying ByteArray. I can see how to use such an ExternalStructure to pass the struct, or a pointer to it, to a function in the library. Is there a similar object I can create which allows me to read/write an array of these structs (i.e. does the proper marshaling to/from a ByteArray)?&nbsp;</div><div><br></div><div>I got the i/f working by rolling my own -- directly filling up a ByteArray with the right number of instances of the serialized-by-hand structure, creating an ExternalData instance with said ByteArray as the handle, and passing this as the parameter. But this doesn't allow me to use the field accessor methods created by ExternalStructure, so it feels like I'm missing something.&nbsp;</div><div><br></div><div>For concreteness, the API looks something like this:</div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(189, 35, 160); ">typedef<span style="color: #000000"> </span>struct</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">{</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; &nbsp; <span style="color: #743aa7">uint32_t</span>&nbsp;someId;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp; &nbsp; <span style="color: #743aa7">int32_t</span>&nbsp; someInt;&nbsp;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">} fooStruct;</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; min-height: 13px; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span style="color: #743aa7">int32_t</span> apiFunction</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">(</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(78, 129, 135); "><span style="color: #000000">&nbsp;</span><span style="color: #bd23a0">const&nbsp;</span><span style="color: #000000">&nbsp;</span><span class="Apple-style-span" style="color: rgb(0, 0, 0); ">fooStruct</span><span style="color: #000000">&nbsp;*foo_list,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp;<span style="color: #743aa7">uint32_t</span>&nbsp;foo_list_size</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">&nbsp;);</div></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Any suggestions?</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Thanks,</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><span class="Apple-style-span" style="font-family: Helvetica; font-size: medium; ">Doug</span></div></body></html>