code: public static Credentials getInputStreamCredential(InputStream inputStream) throws IOException {
      GoogleCredentials credentials = GoogleCredentials.fromStream(inputStream, getHttpTransportFactory());
  
      if (credentials instanceof ServiceAccountCredentials) {
        return getJwtToken((ServiceAccountCredentials)credentials);
      }
      return credentials.createScoped(CLOUD_BIGTABLE_ALL_SCOPES);
    }
docs: Initializes OAuth2 application default credentials based on an inputStream.
  
  @param inputStream a {@link java.io.InputStream} object.
  @return a {@link com.google.auth.Credentials} object.
  @throws java.io.IOException if any.