Top Description Constructors Methods
org.apache.hc.core5.http.impl.nio

public Class BufferedData

extends ExpandableBuffer
Class Inheritance
Imports
java.io.IOException, java.nio.ByteBuffer, java.nio.channels.ReadableByteChannel, .WritableByteChannel, org.apache.hc.core5.util.Args

A buffer that expand its capacity on demand. Internally, this class is backed by an instance of ByteBuffer.

This class is not thread safe.

Since
5.0

Constructor Summary

AccessConstructor and Description
protected
BufferedData(final int bufferSize)

Method Summary

Modifier and TypeMethod and Description
public static BufferedData
allocate(final int bufferSize)

public final int
capacity()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.capacity.

Returns available capacity of this buffer.
public final void
public final ByteBuffer
data()

public final boolean
hasData()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.hasData.

Determines if the buffer contains data.
public final int
length()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.length.

Returns the length of this buffer.
public final void
put(final ByteBuffer src)

public final int
public final int
Inherited from org.apache.hc.core5.http.impl.nio.ExpandableBuffer:
bufferensureAdjustedCapacityensureCapacityexpandmodesetInputModesetOutputModetoString

Constructor Detail

BufferedDataback to summary
protected BufferedData(final int bufferSize)

Method Detail

allocateback to summary
public static BufferedData allocate(final int bufferSize)
capacityback to summary
public final int capacity()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.capacity.

Doc from org.apache.hc.core5.http.impl.nio.ExpandableBuffer.capacity.

Returns available capacity of this buffer.

Returns:int

buffer length.

Annotations
@Override
clearback to summary
public final void clear()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.clear.

Doc from org.apache.hc.core5.http.impl.nio.ExpandableBuffer.clear.

Clears buffer.

Sets the mode to input.

Annotations
@Override
databack to summary
public final ByteBuffer data()
hasDataback to summary
public final boolean hasData()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.hasData.

Doc from org.apache.hc.core5.http.impl.nio.ExpandableBuffer.hasData.

Determines if the buffer contains data.

Sets the mode to output.

Returns:boolean

true if there is data in the buffer, false otherwise.

Annotations
@Override
lengthback to summary
public final int length()

Overrides org.apache.hc.core5.http.impl.nio.ExpandableBuffer.length.

Doc from org.apache.hc.core5.http.impl.nio.ExpandableBuffer.length.

Returns the length of this buffer.

Sets the mode to output.

Returns:int

buffer length.

Annotations
@Override
putback to summary
public final void put(final ByteBuffer src)
readFromback to summary
public final int readFrom(final ReadableByteChannel channel) throws IOException
writeToback to summary
public final int writeTo(final WritableByteChannel dst) throws IOException