Creates an observable stream of BLE beacons, which can be subscribed with RxJava
Uses appropriate BLE scan strategy according to Android version installed on a device

@return Observable stream of beacons
550440
@SuppressLint("MissingPermission")
  @RequiresPermission(anyOf = {
      ACCESS_COARSE_LOCATION, ACCESS_FINE_LOCATION
  })
  public Observable<Beacon> observe() {
    if (!isBleSupported()) {
      return Observable.empty();
    }

    if (isAtLeastAndroidLollipop()) {
      scanStrategy = new LollipopScanStrategy(bluetoothAdapter);
    } else {
      scanStrategy = new PreLollipopScanStrategy(bluetoothAdapter);
    }

    try {
      return observe(scanStrategy);
    } catch (SecurityException e) {
      return Observable.empty();
    }
  }
751728
private XStream getXStreamObject()
    {
        XStream stream = new XStream();
        stream.alias("indexerProperties", IndexerProperties.class);
        stream.alias("node", IndexerProperties.Node.class);
        return stream;
    }
961716
public Observable<Page<ApplicationGatewayInner>> listAllAsync() {
        return listAllWithServiceResponseAsync()
            .map(new Func1<ServiceResponse<Page<ApplicationGatewayInner>>, Page<ApplicationGatewayInner>>() {
                @Override
                public Page<ApplicationGatewayInner> call(ServiceResponse<Page<ApplicationGatewayInner>> response) {
                    return response.body();
                }
            });
    }
689416
protected S getService() {
    // No need to recreate it
    if (service != null) {
      return service;
    }

    Retrofit.Builder retrofitBuilder = new Retrofit.Builder()
      .baseUrl(baseUrl())
      .addConverterFactory(GsonConverterFactory.create(getGsonBuilder().create()));

    if (getCallFactory() != null) {
      retrofitBuilder.callFactory(getCallFactory());
    } else {
      retrofitBuilder.client(getOkHttpClient());
    }

    retrofit = retrofitBuilder.build();
    service = (S) retrofit.create(serviceType);
    return service;
  }
404834
public Blob createBlobFromInputStream(String blobName) {
    // [START createBlobFromInputStream]
    InputStream content = new ByteArrayInputStream("Hello, World!".getBytes(UTF_8));
    Blob blob = bucket.create(blobName, content);
    // [END createBlobFromInputStream]
    return blob;
  }
336184
@Override
    public ReactiveSeq<T> stream() {
        listeningStreams.incrementAndGet(); //assumes all Streams that ever connected, remain connected
        return ReactiveSeq.fromStream(closingStream(this::get, new AlwaysContinue()));
    }
634383
public Stream create(String streamKey) throws PiliException {
        String path = this.baseUrl + "/streams";
        CreateArgs args = new CreateArgs(streamKey);
        String json = gson.toJson(args);

        try {
            cli.callWithJson(path, json);
            StreamInfo streamInfo = new StreamInfo(hub, streamKey);
            return new Stream(streamInfo, cli);
        } catch (PiliException e) {
            throw e;
        } catch (Exception e) {
            throw new PiliException(e);
        }
    }
81530
public Object getCorrectedReceiver() {
        Object receiver = args[0];
        if (receiver==null) {
            if (LOG_ENABLED) LOG.info("receiver is null");
            receiver = NullObject.getNullObject();
        }
        return receiver;
    }
790952
private Observable<String> loadLogsObservable() {

        return Observable.fromCallable(() -> {

            StringBuilder sb = new StringBuilder();

            Context context = appContextRef.get();

            if (context != null) {

                synchronized (sharedLock) {

                    try {

                        File dir = context.getFilesDir();

                        String line;

                        for (int i = 1; i <= maxFiles; i++) {

                            File file = new File(dir, name(i));

                            if (file.exists()) {
                                inputStream = new FileInputStream(file);
                                BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
                                while ((line = reader.readLine()) != null) {
                                    sb.append(line).append('\n');
                                }
                                reader.close();
                            }
                        }
                    } catch (Exception e) {
                        throw Exceptions.propagate(e);
                    } finally {
                        sharedLock.notifyAll();
                    }
                }
            }

            return sb.toString();
        });
    }
887108
public java.util.List<LogStream> getLogStreams() {
        if (logStreams == null) {
            logStreams = new com.amazonaws.internal.SdkInternalList<LogStream>();
        }
        return logStreams;
    }
128137
public BufferedInputStream asBufferedInputStream() {
        InputStream is = asInputStream();
        if (is == null) return null;
        if (is instanceof BufferedInputStream) return (BufferedInputStream) is;
        return new BufferedInputStream(is);
    }
992785
public function getBitStream()
    {

        $bstream = $this->mergeBitStream();

        if($bstream == null) {
            return null;
        }

        $ret = $this->appendPaddingBit($bstream);
        if($ret < 0) {
            return null;
        }

        return $bstream;
    }
397337
private SubscriptionMessage createSubscriptionMessage()
  {
    if (tc.isEntryEnabled())
      SibTr.entry(tc, "createSubscriptionMessage");

    ControlMessageFactory factory = null;
    SubscriptionMessage subscriptionMessage = null;

    try
    {
      factory = MessageProcessor.getControlMessageFactory();
      subscriptionMessage = factory.createNewSubscriptionMessage();
    }
    catch (Exception e)
    {
      FFDCFilter.processException(
        e,
        "com.ibm.ws.sib.processor.proxyhandler.SubscriptionMessageHandler.createSubscriptionMessage",
        "1:162:1.34",
        this);
        
      SibTr.exception(tc, e);
    }

    if (tc.isEntryEnabled())
      SibTr.exit(tc, "createSubscriptionMessage", subscriptionMessage);

    return subscriptionMessage;
  }
285995
public static ObservableExecutor getInstance() {

        return new ObservableExecutor() {

            @Override
            public <T> void execute(final Observable<T> obs) {
                obs.subscribeOn(Schedulers.io())
                        .observeOn(Schedulers.io())
                        .subscribe(new Subscriber<T>() {
                            @Override
                            public void onCompleted() {
                                // Completed, will unsubscribe automatically
                            }

                            @Override
                            public void onError(Throwable e) {
                                // Report errors in doOnError
                            }

                            @Override
                            public void onNext(T t) {
                                // Ignore result
                            }
                        });
            }
        };
    }
82029
public Blob createBlobFromInputStream(String bucketName, String blobName) {
    // [START createBlobFromInputStream]
    InputStream content = new ByteArrayInputStream("Hello, World!".getBytes(UTF_8));
    BlobId blobId = BlobId.of(bucketName, blobName);
    BlobInfo blobInfo = BlobInfo.newBuilder(blobId).setContentType("text/plain").build();
    Blob blob = storage.create(blobInfo, content);
    // [END createBlobFromInputStream]
    return blob;
  }
644066
public Single<ByteBuf> getSeqnos() {
    return Single.create(new Single.OnSubscribe<ByteBuf>() {
      @Override
      public void call(final SingleSubscriber<? super ByteBuf> subscriber) {
        if (state() != LifecycleState.CONNECTED) {
          subscriber.onError(new NotConnectedException());
          return;
        }

        ByteBuf buffer = Unpooled.buffer();
        DcpGetPartitionSeqnosRequest.init(buffer);
        DcpGetPartitionSeqnosRequest.vbucketState(buffer, VbucketState.ACTIVE);

        sendRequest(buffer).addListener(new DcpResponseListener() {
          @Override
          public void operationComplete(Future<DcpResponse> future) throws Exception {
            if (future.isSuccess()) {
              ByteBuf buf = future.getNow().buffer();
              try {
                subscriber.onSuccess(MessageUtil.getContent(buf).copy());
              } finally {
                buf.release();
              }
            } else {
              subscriber.onError(future.cause());
            }
          }
        });
      }
    });
  }
130322
@Nonnull
  @ReturnsMutableCopy
  public static IHasInputStream create (@Nonnull final NonBlockingByteArrayOutputStream aBAOS)
  {
    ValueEnforcer.notNull (aBAOS, "BAOS");
    return new HISNBBAOS (aBAOS);
  }