public static X509ExtensionSet load(InputStream is) throws X509ExtensionSetLoadException, IOException {
  DataInputStream dis=null;
  try {
    dis=new DataInputStream(is);
    long magicNumber=dis.readLong();
    if (magicNumber != FILE_MAGIC_NUMBER) {
      throw new X509ExtensionSetLoadException(res.getString("NoLoadX509ExtensionSet.BadMagicNumber.exception.message"));
    }
    int version=dis.readInt();
    if (version != FILE_VERSION) {
      throw new X509ExtensionSetLoadException(res.getString("NoLoadX509ExtensionSet.WrongVersion.exception.message"));
    }
    X509ExtensionSet x509ExtensionSet=new X509ExtensionSet();
    x509ExtensionSet.criticalExtensions=loadExtensions(dis);
    x509ExtensionSet.nonCriticalExtensions=loadExtensions(dis);
    return x509ExtensionSet;
  }
 catch (  EOFException ex) {
    throw new X509ExtensionSetLoadException(res.getString("NoLoadX509ExtensionSet.NotEnoughBytes.exception.message"));
  }
 finally {
    IOUtils.closeQuietly(dis);
  }
}

public static X509ExtensionSet load ( InputStream is ) throws X509ExtensionSetLoadException , IOException { DataInputStream dis = null ; try { dis = new DataInputStream ( is ) ; long magicNumber = dis . readLong ( ) ; if ( magicNumber != FILE_MAGIC_NUMBER ) { throw new X509ExtensionSetLoadException ( res . getString ( "NoLoadX509ExtensionSet.BadMagicNumber.exception.message" ) ) ; } int version = dis . readInt ( ) ; if ( version != FILE_VERSION ) { throw new X509ExtensionSetLoadException ( res . getString ( "NoLoadX509ExtensionSet.WrongVersion.exception.message" ) ) ; } X509ExtensionSet x509ExtensionSet = new X509ExtensionSet ( ) ; x509ExtensionSet . criticalExtensions = loadExtensions ( dis ) ; x509ExtensionSet . nonCriticalExtensions = loadExtensions ( dis ) ; return x509ExtensionSet ; } catch ( EOFException ex ) { throw new X509ExtensionSetLoadException ( res . getString ( "NoLoadX509ExtensionSet.NotEnoughBytes.exception.message" ) ) ; } finally { IOUtils . closeQuietly ( dis ) ; } }
load x . 509 extension set .
