code: public static KeyStore load(InputStream in, char[] password) {
  
          try {
              KeyStore myTrustStore = KeyStore.getInstance(KeyStore.getDefaultType());
              myTrustStore.load(in, password);
              return myTrustStore;
          } catch (CertificateException | NoSuchAlgorithmException | KeyStoreException | IOException e) {
              throw new TrustManagerLoadFailedException(e);
          } finally {
              Closeables.closeQuietly(in);
          }
      }
docs: Load keystore from InputStream, close the stream after load succeed or failed.