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:
    EntityDetails, AsyncDataProducer, AsyncEntityProducer, ResourceHolder
  Enclosing class:
    AsyncRandomHandler

      public static class AsyncRandomHandler.RandomBinAsyncEntityProducer
      extends AbstractBinAsyncEntityProducer

  An entity that generates random data.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RandomBinAsyncEntityProducer(long len)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `availableData()`
    `void` | `failed(Exception cause)`
    `long` | `getContentLength()`
    `boolean` | `isRepeatable()`
    `protected void` | `produceData(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

    - #### RandomBinAsyncEntityProducer

          public RandomBinAsyncEntityProducer(long len)

  - ### Method Detail

    - #### releaseResources

          public void releaseResources()

      Specified by:
        `releaseResources` in interface `ResourceHolder`
      Overrides:
        `releaseResources` in class `AbstractBinAsyncEntityProducer`

    - #### isRepeatable

          public boolean isRepeatable()

    - #### getContentLength

          public long getContentLength()

      Specified by:
        `getContentLength` in interface `EntityDetails`
      Overrides:
        `getContentLength` in class `AbstractBinAsyncEntityProducer`

    - #### availableData

          public int availableData()

      Specified by:
        `availableData` in class `AbstractBinAsyncEntityProducer`

    - #### produceData

          protected void produceData(StreamChannel<ByteBuffer> channel)
                              throws IOException

      Specified by:
        `produceData` in class `AbstractBinAsyncEntityProducer`
      Throws:
        `IOException`

    - #### failed

          public void failed(Exception cause)

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