org.apache.hc.client5.testing.async

## Class AsyncRandomHandler.RandomBinAsyncEntityProducer

- java.lang.Object
- - org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer
  - - org.apache.hc.client5.testing.async.AsyncRandomHandler.RandomBinAsyncEntityProducer

- All Implemented Interfaces:
    org.apache.hc.core5.http.EntityDetails, org.apache.hc.core5.http.nio.AsyncDataProducer, org.apache.hc.core5.http.nio.AsyncEntityProducer, org.apache.hc.core5.http.nio.ResourceHolder
  Enclosing class:
    AsyncRandomHandler

      public static class AsyncRandomHandler.RandomBinAsyncEntityProducer
      extends org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer

  An entity that generates random data.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `AsyncRandomHandler.RandomBinAsyncEntityProducer(long len)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `availableData()`
    `void` | `failed(Exception cause)`
    `long` | `getContentLength()`
    `boolean` | `isRepeatable()`
    `protected void` | `produceData(org.apache.hc.core5.http.nio.StreamChannel<ByteBuffer> channel)`
    `void` | `releaseResources()`

    - ### Methods inherited from class org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer

      `available, getContentEncoding, getContentType, getTrailerNames, isChunked, produce`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### AsyncRandomHandler.RandomBinAsyncEntityProducer

          public AsyncRandomHandler.RandomBinAsyncEntityProducer(long len)

  - ### Method Detail

    - #### releaseResources

          public void releaseResources()

      Specified by:
        `releaseResources` in interface `org.apache.hc.core5.http.nio.ResourceHolder`
      Overrides:
        `releaseResources` in class `org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer`

    - #### isRepeatable

          public boolean isRepeatable()

    - #### getContentLength

          public long getContentLength()

      Specified by:
        `getContentLength` in interface `org.apache.hc.core5.http.EntityDetails`
      Overrides:
        `getContentLength` in class `org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer`

    - #### availableData

          public int availableData()

      Specified by:
        `availableData` in class `org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer`

    - #### produceData

          protected void produceData(org.apache.hc.core5.http.nio.StreamChannel<ByteBuffer> channel)
                              throws IOException

      Specified by:
        `produceData` in class `org.apache.hc.core5.http.nio.entity.AbstractBinAsyncEntityProducer`
      Throws:
        `IOException`

    - #### failed

          public void failed(Exception cause)

Copyright © 1999–2022 The Apache Software Foundation. All rights reserved.