public static ReferenceDetector loadManifest(InputStream referenceManifest) throws IOException {
  try (final ReferenceManifestParser parser=new ReferenceManifestParser(referenceManifest)){
    parser.parse();
    return parser.getReferenceDetector();
  }
 }

public static ReferenceDetector loadManifest ( InputStream referenceManifest ) throws IOException { try ( final ReferenceManifestParser parser = new ReferenceManifestParser ( referenceManifest ) ) { parser . parse ( ) ; return parser . getReferenceDetector ( ) ; } }
loads the manifest in the supplied stream
