question: protected void fillMemData ( Object data , int [ ] posits , int length , Object output , int outputOffset , int dim ) { if ( data instanceof Object [ ] ) { Object [ ] xo = ( Object [ ] ) data ; fillMemData ( xo [ posits [ dim ] ] , posits , length , output , outputOffset , dim + 1 ) ; } else { int startFrom = posits [ dim ] ; int startTo = outputOffset ; int copyLength = length ; if ( posits [ dim ] < 0 ) { startFrom -= posits [ dim ] ; startTo -= posits [ dim ] ; copyLength += posits [ dim ] ; } if ( posits [ dim ] + length > this . dims [ dim ] ) { copyLength -= posits [ dim ] + length - this . dims [ dim ] ; } System . arraycopy ( data , startFrom , output , startTo , copyLength ) ; } }
target:  Fill a single segment from memory. This routine is called recursively to handle multi-dimensional arrays. E.g., if data is three-dimensional, this will recurse two levels until we get a call with a single dimensional datum. At that point the appropriate data will be copied into the output.