private Optional < LoadInfo > maybeGetLoadInfo ( DataDirectoryKey dataDirKey ) { Optional < DataDirEntry > dirEntry = optHeader . maybeGetDataDirEntry ( dataDirKey ) ; if ( dirEntry . isPresent ( ) ) { long virtualAddress = dirEntry . get ( ) . getVirtualAddress ( ) ; Optional < Long > maybeOffset = maybeGetFileOffsetFor ( dataDirKey ) ; if ( ! maybeOffset . isPresent ( ) ) { logger . info ( "unable to get file offset for " + dataDirKey ) ; } long offset = maybeOffset . or ( - 1L ) ; return Optional . of ( new LoadInfo ( offset , virtualAddress , getMemoryMappedPE ( ) , data , this ) ) ; } return Optional . absent ( ) ; }
Assembles the loadInfo object for the dataDirKey .