question: public static boolean isFileOfSupportedSchema ( ResourceByteRangeProvider resourceByteRangeProvider ) throws IOException { try ( InputStream inputStream = resourceByteRangeProvider . getByteRangeAsStream ( 0 , resourceByteRangeProvider . getResourceSize ( ) - 1 ) ) { DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory . newInstance ( ) ; documentBuilderFactory . setNamespaceAware ( true ) ; DocumentBuilder documentBuilder = documentBuilderFactory . newDocumentBuilder ( ) ; Document document = documentBuilder . parse ( inputStream ) ; NodeList nodeList = null ; for ( String supportedSchemaURI : supportedPKLNamespaces ) { nodeList = document . getElementsByTagNameNS ( supportedSchemaURI , "PackingList" ) ; if ( nodeList != null && nodeList . getLength ( ) == 1 ) { return true ; } } } catch ( ParserConfigurationException | SAXException e ) { return false ; } return false ; }
target:  A stateless method that verifies if the raw data represented by the ResourceByteRangeProvider corresponds to a valid IMF Packing List document