static public Object readDataFill ( LayoutBB layout , DataType dataType , Object fillValue ) throws java . io . IOException { long size = layout . getTotalNelems ( ) ; if ( dataType == DataType . STRUCTURE ) size *= layout . getElemSize ( ) ; Object arr = ( fillValue == null ) ? makePrimitiveArray ( ( int ) size , dataType ) : makePrimitiveArray ( ( int ) size , dataType , fillValue ) ; return readData ( layout , dataType , arr ) ; }
Read data subset from ByteBuffer create primitive array of size Layout . getTotalNelems . Reading is controlled by the Layout object .