Convert to a {@link InputStream} inbound {@link Flux}

@return a {@link InputStream} inbound {@link Flux}
179934
public Flux<InputStream> asInputStream() {
		return handle((bb, sink) -> {
			try {
				sink.next(new ByteBufMono.ReleasingInputStream(bb));
			}
			catch (IllegalReferenceCountException e) {
				sink.complete();
			}
		});
	}
561738
public InputStream getInputStream() {
        try
        {
            int responseCode = this.urlConnection.getResponseCode();

            try
            {
                // HACK: manually follow redirects, for the login to work
                // HTTPUrlConnection auto redirect doesn't respect the provided headers
                if(responseCode ==302)
                {
                    HttpClient redirectClient =
                            new HttpClient(proxyHost,proxyPort, urlConnection.getHeaderField("Location"),
                                    headers, urlConnection.getRequestMethod(), callback, authHeader);
                    redirectClient.getInputStream().close();
                }
            }
            catch (Throwable e)
            {
                System.out.println("Following redirect failed");
            }

            setCookieHeader = this.urlConnection.getHeaderField("Set-Cookie");


            InputStream in = responseCode != HttpURLConnection.HTTP_OK ?
                    this.urlConnection.getErrorStream() : this.urlConnection.getInputStream();

            return in;
        } catch (Exception e) {
            return null;
        }
    }
294983
public String transferStream(InputStream in, int size)
    {
        StringBuilder sb = new StringBuilder();
        try {
            byte[] cbuf = new byte[1000];
            int iLen = Math.max(size, cbuf.length);
            while ((iLen = in.read(cbuf, 0, iLen)) > 0)
            {   // Write the entire file to the output buffer
                for (int i = 0; i < iLen; i++)
                {
                    sb.append(Character.toChars(cbuf[i]));
                }
                size = size - iLen;
                iLen = Math.max(size, cbuf.length);
            }
        } catch (MalformedURLException ex)  {
            ex.printStackTrace();
        } catch (IOException ex) {
            ex.printStackTrace();
        }
        return sb.toString();
    }
1048847
public <U> SimpleReactStream<U> fromStream(final Stream<CompletableFuture<U>> stream) {

        final Stream s = stream;
        return construct(s);
    }
645860
private byte[] convertInputStreamToBytes(InputStream in) throws IOException {
        ByteArrayOutputStream buffer = new ByteArrayOutputStream();

        int len;
        byte[] data = new byte[16384];

        while ((len = in.read(data, 0, data.length)) != -1) {
            buffer.write(data, 0, len);
        }

        buffer.flush();
        return buffer.toByteArray();
    }
414745
protected InputStream getInputStream()
        throws IOException
    {
        if (is == null && server != null)
            is = server.readChannel(channel);

        return is;
    }
1017394
@Override
    public InputStream getInputStream() throws IOException {
	if (barr == null) {
	    barr = IOUtil.toBytes(url.openStream());
	}
	return new ByteArrayInputStream(barr);
    }
888355
public InputStream newInputStream() {
        return new InputStream() {
            private int pos = 0;
            public int read() throws IOException {
                synchronized(ByteBuffer.this) {
                    if(pos>=size)   return -1;
                    return buf[pos++];
                }
            }

            public int read(byte[] b, int off, int len) throws IOException {
                synchronized(ByteBuffer.this) {
                    if(size==pos)
                        return -1;

                    int sz = Math.min(len,size-pos);
                    System.arraycopy(buf,pos,b,off,sz);
                    pos+=sz;
                    return sz;
                }
            }


            public int available() throws IOException {
                synchronized(ByteBuffer.this) {
                    return size-pos;
                }
            }

            public long skip(long n) throws IOException {
                synchronized(ByteBuffer.this) {
                    int diff = (int) Math.min(n,size-pos);
                    pos+=diff;
                    return diff;
                }
            }
        };
    }
804217
public static BufferedInputStream toBuffered(InputStream in) {
		return (in instanceof BufferedInputStream) ? (BufferedInputStream) in : new BufferedInputStream(in);
	}
1083619
public Mono<InputStream> asInputStream() {
		return handle((bb, sink) -> {
			try {
				sink.next(new ReleasingInputStream(bb));
			}
			catch (IllegalReferenceCountException e) {
				sink.complete();
			}
		});
	}
437943
public InputStream getInputStream()
    throws IOException
  {
    if (_is == null)
      _is = new FileInputStream(_file.getFD());

    return _is;
  }
1242609
public InputStream openInputStream()
    throws IOException
  {
    StreamSource indirectSource = _indirectSource;
    
    if (indirectSource != null) {
      return indirectSource.openInputStream();
    }
    
    TempOutputStream out = _out;
    if (out != null) {
      return out.openInputStreamNoFree();
    }
    
    // System.err.println("OpenInputStream: fail to open input stream for " + this);
    throw new IOException(L.l("{0}: no input stream is available",
                              this));
  }
1072521
public final static <T> CompletableFuture<List<T>> streamToCompletableFuture(final Stream<T> stream) {
        return CompletableFuture.completedFuture(stream.collect(Collectors.toList()));

    }
443960
@Override
    public InputStream getInputStream() throws IOException, IllegalStateException {
        if (this.read) {
            throw new IllegalStateException("InputStream has already been read - " +
                    "do not use InputStreamResource if a stream needs to be read multiple times");
        }
        this.read = true;
        return this.inputStream;
    }
562431
protected synchronized InputStream getInputStream() throws IOException {
        if (isClosedOrPending()) {
            throw new IOException("Socket Closed");
        }
        if (shut_rd) {
            throw new IOException("Socket input is shutdown");
        }
        if (socketInputStream == null) {
            socketInputStream = new SocketInputStream(this);
        }
        return socketInputStream;
    }
1281488
public static byte[] getContent(InputStream in) throws IOException {
    try {
      ByteArrayOutputStream baos = new ByteArrayOutputStream();
      copy(in, baos);
      return baos.toByteArray();
    }
    finally {
      in.close();
    }
  }
418662
public @Nullable InputStream getInputStream() {
    if (mInputStreamSupplier != null) {
      return mInputStreamSupplier.get();
    }
    CloseableReference<PooledByteBuffer> pooledByteBufferRef =
        CloseableReference.cloneOrNull(mPooledByteBufferRef);
    if (pooledByteBufferRef != null) {
      try {
        return new PooledByteBufferInputStream(pooledByteBufferRef.get());
      } finally {
        CloseableReference.closeSafely(pooledByteBufferRef);
      }
    }
    return null;
  }