public static class RandomHandler.RandomEntity
extends org.apache.hc.core5.http.io.entity.AbstractHttpEntity
writeTo
 but not getContent.| Modifier and Type | Field and Description | 
|---|---|
| protected long | lengthThe length of the random data to generate. | 
| Constructor and Description | 
|---|
| RandomHandler.RandomEntity(long len)Creates a new entity generating the given amount of data. | 
| Modifier and Type | Method and Description | 
|---|---|
| void | close() | 
| InputStream | getContent()Not supported. | 
| long | getContentLength()Obtains the size of the random data. | 
| boolean | isRepeatable()Tells that this entity is repeatable, in a way. | 
| boolean | isStreaming()Tells that this entity is not streaming. | 
| void | writeTo(OutputStream out)Generates the random content. | 
public RandomHandler.RandomEntity(long len)
len - the number of random bytes to generate,
              0 to maxintpublic final boolean isStreaming()
public boolean isRepeatable()
isRepeatable in interface org.apache.hc.core5.http.HttpEntityisRepeatable in class org.apache.hc.core5.http.io.entity.AbstractHttpEntitytruepublic long getContentLength()
public InputStream getContent()
public void writeTo(OutputStream out) throws IOException
writeTo in interface org.apache.hc.core5.http.HttpEntitywriteTo in class org.apache.hc.core5.http.io.entity.AbstractHttpEntityout - where to write the content toIOExceptionpublic void close()
           throws IOException
IOExceptionCopyright © 1999–2021 The Apache Software Foundation. All rights reserved.