APIdia Launch Partner
Top Description Inners Constructors Methods
jdk.internal.net.http.quic

public abstract sealed Class BuffersReader

extends Object
permits SingleBufferReader, ListBuffersReader
Class Inheritance
Known Direct Subclasses
jdk.internal.net.http.quic.BuffersReader.SingleBufferReader, jdk.internal.net.http.quic.BuffersReader.ListBuffersReader
Imports
java.nio.BufferUnderflowException, .ByteBuffer, java.util.ArrayList, .List, .Objects

A class that allows to read data from an aggregation of ByteBuffer. This is mostly geared to reading Quic or HTTP/3 frames that are composed of an aggregation of Variable Length Integers. This class is not multi-thread safe.

The BuffersReader class is an abstract class with two concrete implementations: SingleBufferReader and ListBuffersReader.

The SingleBufferReader presents a simple lightweight view of a single ByteBuffer. Instances of SingleBufferReader can be created by calling BuffersReader.single(buffer);

The ListBuffersReader view can be created from a (possibly empty) list of byte buffers. New byte buffers can be later added to the ListBuffersReader instance as they become available. Once a frame has been fully received, BuffersReader#release() or BuffersReader#getAndRelease(long) should be called to forget and relinquish all bytes buffers up to the current position of the BuffersReader. Released buffers are removed from BuffersReader list, and the position of the reader is reset to 0, allowing to read the next frame from the remaining data.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
public static class
BuffersReader.ListBuffersReader

A BuffersReader that iterates over a list of ByteBuffers.

public static class
BuffersReader.SingleBufferReader

A lightweight view allowing to see a ByteBuffer as a BuffersReader.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
clear()

Release all buffers held by this BuffersReader, whether consumed or unconsumed.

public abstract byte

Returns:

the byte at the current position
get
()

Reads one byte from the reader.

public abstract byte

Returns:

the byte at the given position in the reader
get
(long
the position of the byte
position
)

Reads the byte located at the given position in the reader.

public abstract List<ByteBuffer>

Returns:

a list of ByteBuffer containing the next bytes of data, starting at the current position.
getAndRelease
(long
the amount of bytes to read and move to the returned list.
bytes
)

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data.

public boolean

Returns:

true if the reader has remaining bytes to the read
hasRemaining
()

Returns true if the reader has remaining bytes to the read.

public abstract boolean

Returns:

true if this BuffersReader is empty
isEmpty
()

Returns true if this BuffersReader is empty.

public abstract long

Returns:

the limit of the reader
limit
()

Returns the limit of the reader.

public static BuffersReader.ListBuffersReader

Returns:

an empty ListBuffersReader
list
()

Creates an empty ListBuffersReader.

public static BuffersReader.ListBuffersReader

Returns:

a ListBuffersReader
list
(ByteBuffer buffer)

Creates a ListBuffersReader with the given buffer.

public static BuffersReader.ListBuffersReader

Returns:

a ListBuffersReader
list
(List<ByteBuffer> buffers)

Creates a ListBuffersReader with the given buffers list.

public abstract long

Returns:

The offset of this BuffersReader
offset
()

Returns The offset of this BuffersReader.

public abstract long

Returns:

the current position of the reader
position
()

Returns the current position of the reader.

public abstract void
position(long
the new position
newPosition
)

Sets the position of the reader.

public abstract long

Returns:

the cumulated amount of data that has been read in this BuffersReader since its creation
read
()

Returns the cumulated amount of data that has been read in this BuffersReader since its creation.

public abstract void
release()

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

public long

Returns:

the number of bytes that remain to read
remaining
()

Returns the number of bytes that remain to read.

public static BuffersReader.SingleBufferReader

Returns:

a lightweight SingleBufferReader view over a single ByteBuffer
single
(ByteBuffer
a byte buffer
buffer
)

Creates a lightweight SingleBufferReader view over a single ByteBuffer.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BuffersReaderback to summary
public BuffersReader()

Method Detail

clearback to summary
public abstract void clear()

Release all buffers held by this BuffersReader, whether consumed or unconsumed. Released buffer are all set to their limit.

getback to summary
public abstract byte get()

Reads one byte from the reader. This method increase the position by one. The semantic is similar to ByteBuffer#get().

Returns:byte

the byte at the current position

Exceptions
BufferUnderflowException:
if trying to read past the limit.
getback to summary
public abstract byte get(long position)

Reads the byte located at the given position in the reader. The semantic is similar to ByteBuffer#get(int). This method doesn't change the position of the reader.

Parameters
position:long

the position of the byte

Returns:byte

the byte at the given position in the reader

Exceptions
IndexOutOfBoundsException:
if trying to read before the reader's position or after the reader's limit
getAndReleaseback to summary
public abstract List<ByteBuffer> getAndRelease(long bytes)

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data. .

Parameters
bytes:long

the amount of bytes to read and move to the returned list.

Returns:List<ByteBuffer>

a list of ByteBuffer containing the next bytes of data, starting at the current position.

Exceptions
BufferUnderflowException:
if attempting to read past the limit
hasRemainingback to summary
public boolean hasRemaining()

Returns true if the reader has remaining bytes to the read. The semantic is similar to ByteBuffer#hasRemaining().

Returns:boolean

true if the reader has remaining bytes to the read

isEmptyback to summary
public abstract boolean isEmpty()

Returns true if this BuffersReader is empty. A BuffersReader is empty if it has been {@linkplain #list() created empty, or if it has been released after all data has been read.

Returns:boolean

true if this BuffersReader is empty

limitback to summary
public abstract long limit()

Returns the limit of the reader. The semantic is similar to ByteBuffer#limit().

Returns:long

the limit of the reader

listback to summary
public static BuffersReader.ListBuffersReader list()

Creates an empty ListBuffersReader.

Returns:BuffersReader.ListBuffersReader

an empty ListBuffersReader

listback to summary
public static BuffersReader.ListBuffersReader list(ByteBuffer buffer)

Creates a ListBuffersReader with the given buffer. More buffers can be later added as they become available.

Returns:BuffersReader.ListBuffersReader

a ListBuffersReader

listback to summary
public static BuffersReader.ListBuffersReader list(List<ByteBuffer> buffers)

Creates a ListBuffersReader with the given buffers list. More buffers can be later added as they become available.

Returns:BuffersReader.ListBuffersReader

a ListBuffersReader

offsetback to summary
public abstract long offset()

Returns The offset of this BuffersReader. This is the position in the first ByteBuffer that was set on the reader. The BuffersReader will not allow to get or set a position lower than the offset.

Returns:long

The offset of this BuffersReader

positionback to summary
public abstract long position()

Returns the current position of the reader. The semantic is similar to ByteBuffer#position().

Returns:long

the current position of the reader

positionback to summary
public abstract void position(long newPosition)

Sets the position of the reader. The semantic is similar to ByteBuffer#position(int).

Parameters
newPosition:long

the new position

Exceptions
IllegalArgumentException:
if trying to set the position to a negative value, or to a value past the limit
readback to summary
public abstract long read()

Returns the cumulated amount of data that has been read in this BuffersReader since its creation. This number is not reset when calling release().

Returns:long

the cumulated amount of data that has been read in this BuffersReader since its creation

releaseback to summary
public abstract void release()

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

remainingback to summary
public long remaining()

Returns the number of bytes that remain to read. The semantic is similar to ByteBuffer#remaining().

Returns:long

the number of bytes that remain to read

singleback to summary
public static BuffersReader.SingleBufferReader single(ByteBuffer buffer)

Creates a lightweight SingleBufferReader view over a single ByteBuffer.

Parameters
buffer:ByteBuffer

a byte buffer

Returns:BuffersReader.SingleBufferReader

a lightweight SingleBufferReader view over a single ByteBuffer

jdk.internal.net.http.quic back to summary

private final Record BuffersReader.Buffer

extends Record
Class Inheritance
Record Components
buffer:ByteBuffer 
offset:int 
limit:int 

Field Summary

Modifier and TypeField and Description
private final ByteBuffer
buffer

Record Component accessed by buffer().

private final int
limit

Record Component accessed by limit().

private final int
offset

Record Component accessed by offset().

Constructor Summary

AccessConstructor and Description
pack-priv
Buffer(ByteBuffer buffer, int offset, int limit)

pack-priv

Method Summary

Modifier and TypeMethod and Description
public ByteBuffer
buffer()

Record Component getter of buffer.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public int
limit()

Record Component getter of limit.

public int
offset()

Record Component getter of offset.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

bufferback to summary
private final ByteBuffer buffer

Record Component accessed by buffer().

limitback to summary
private final int limit

Record Component accessed by limit().

offsetback to summary
private final int offset

Record Component accessed by offset().

Constructor Detail

Bufferback to summary
pack-priv Buffer(ByteBuffer buffer, int offset, int limit)
Bufferback to summary
pack-priv Buffer(ByteBuffer buffer)

Method Detail

bufferback to summary
public ByteBuffer buffer()

Record Component getter of buffer.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

limitback to summary
public int limit()

Record Component getter of limit.

offsetback to summary
public int offset()

Record Component getter of offset.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

jdk.internal.net.http.quic back to summary

public final Class BuffersReader.ListBuffersReader

extends BuffersReader
Class Inheritance

A BuffersReader that iterates over a list of ByteBuffers. New ByteBuffers can be added at the end of list by calling add(ByteBuffer) or addAll(List), which increases the limit accordingly.

When released, the data prior to the current position() is discarded, the position and offset are reset to 0, and the limit is set to the amount of remaining data.

A ListBuffersReader can be reused after being released. If it still contains data, the offset will be 0. Otherwise, the offset will be set to the position of the first buffer added to the ListBuffersReader.

Field Summary

Modifier and TypeField and Description
private final List<BuffersReader.Buffer>
private BuffersReader.Buffer
private long
private long
private int
private long
private long
private long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public BuffersReader.ListBuffersReader

Returns:

this reader
add
(ByteBuffer
a byte buffer
buffer
)

Adds a new ByteBuffer to this BuffersReader.

public BuffersReader.ListBuffersReader

Returns:

this reader
addAll
(List<ByteBuffer>
a list of ByteBuffers
buffers
)

Adds a list of byte buffers to this reader.

public void
clear()

Implements abstract jdk.internal.net.http.quic.BuffersReader.clear.

Release all buffers held by this BuffersReader, whether consumed or unconsumed.

private ByteBuffer

Returns:

the current ByteBuffer in which to find the byte at the current position()
current
(boolean
if true, calling this method will throw BufferUnderflowException if the position is past the limit.
throwIfUnderflow
)

Returns the current ByteBuffer in which to find the byte at the current position().

public byte
get()

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Reads one byte from the reader.

public byte
get(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Reads the byte located at the given position in the reader.

public List<ByteBuffer>
getAndRelease(long bytes)

Implements abstract jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data.

public boolean
isEmpty()

Implements abstract jdk.internal.net.http.quic.BuffersReader.isEmpty.

Returns true if this BuffersReader is empty.

public long
limit()

Implements abstract jdk.internal.net.http.quic.BuffersReader.limit.

Returns the limit of the reader.

public long
offset()

Implements abstract jdk.internal.net.http.quic.BuffersReader.offset.

Returns The offset of this BuffersReader.

public long
position()

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Returns the current position of the reader.

public void
position(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Sets the position of the reader.

public long
read()

Implements abstract jdk.internal.net.http.quic.BuffersReader.read.

Returns the cumulated amount of data that has been read in this BuffersReader since its creation.

public void
release()

Implements abstract jdk.internal.net.http.quic.BuffersReader.release.

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

Inherited from jdk.internal.net.http.quic.BuffersReader:
hasRemaininglistlistlistremainingsingle

Field Detail

buffersback to summary
private final List<BuffersReader.Buffer> buffers
currentback to summary
private BuffersReader.Buffer current
currentOffsetback to summary
private long currentOffset
limitback to summary
private long limit
nextIndexback to summary
private int nextIndex
positionback to summary
private long position
readAndReleasedback to summary
private long readAndReleased
startback to summary
private long start

Constructor Detail

ListBuffersReaderback to summary
pack-priv ListBuffersReader()

Method Detail

addback to summary
public BuffersReader.ListBuffersReader add(ByteBuffer buffer)

Adds a new ByteBuffer to this BuffersReader. If the reader is empty, the reader's offset and position is set to the buffer's position, and the reader limit is set to the buffer's limit. Otherwise, the reader's limit is simply increased by the buffer's remaining bytes. The reader will only allow to read those bytes between the current position and limit of the buffer.

API Note

This class doesn't make defensive copies of the provided buffers, so the caller must not modify the buffer's position or limit after it's been added to the reader.

Parameters
buffer:ByteBuffer

a byte buffer

Returns:BuffersReader.ListBuffersReader

this reader

addAllback to summary
public BuffersReader.ListBuffersReader addAll(List<ByteBuffer> buffers)

Adds a list of byte buffers to this reader. This is equivalent to calling:

ListBuffersReader reader = ...; for (var buffer : buffers) { reader.add(buffer); }
ListBuffersReader reader = ...;
for (var buffer : buffers) {
    reader.add(buffer);
}
Parameters
buffers:List<ByteBuffer>

a list of ByteBuffers

Returns:BuffersReader.ListBuffersReader

this reader

clearback to summary
public void clear()

Implements abstract jdk.internal.net.http.quic.BuffersReader.clear.

Doc from jdk.internal.net.http.quic.BuffersReader.clear.

Release all buffers held by this BuffersReader, whether consumed or unconsumed. Released buffer are all set to their limit.

Annotations
@Override
currentback to summary
private ByteBuffer current(boolean throwIfUnderflow)

Returns the current ByteBuffer in which to find the byte at the current position().

Parameters
throwIfUnderflow:boolean

if true, calling this method will throw BufferUnderflowException if the position is past the limit.

Returns:ByteBuffer

the current ByteBuffer in which to find the byte at the current position()

Exceptions
BufferUnderflowException:
if attempting to read past the limit and throwIfUnderflow == true
getback to summary
public byte get()

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Doc from jdk.internal.net.http.quic.BuffersReader.get.

Reads one byte from the reader. This method increase the position by one. The semantic is similar to ByteBuffer#get().

Annotations
@Override
getback to summary
public byte get(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Doc from jdk.internal.net.http.quic.BuffersReader.get.

Reads the byte located at the given position in the reader. The semantic is similar to ByteBuffer#get(int). This method doesn't change the position of the reader.

Annotations
@Override
getAndReleaseback to summary
public List<ByteBuffer> getAndRelease(long bytes)

Implements abstract jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Doc from jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data. .

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements abstract jdk.internal.net.http.quic.BuffersReader.isEmpty.

Doc from jdk.internal.net.http.quic.BuffersReader.isEmpty.

Returns true if this BuffersReader is empty. A BuffersReader is empty if it has been {@linkplain #list() created empty, or if it has been released after all data has been read.

Annotations
@Override
limitback to summary
public long limit()

Implements abstract jdk.internal.net.http.quic.BuffersReader.limit.

Doc from jdk.internal.net.http.quic.BuffersReader.limit.

Returns the limit of the reader. The semantic is similar to ByteBuffer#limit().

Annotations
@Override
offsetback to summary
public long offset()

Implements abstract jdk.internal.net.http.quic.BuffersReader.offset.

Doc from jdk.internal.net.http.quic.BuffersReader.offset.

Returns The offset of this BuffersReader. This is the position in the first ByteBuffer that was set on the reader. The BuffersReader will not allow to get or set a position lower than the offset.

Annotations
@Override
positionback to summary
public long position()

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Doc from jdk.internal.net.http.quic.BuffersReader.position.

Returns the current position of the reader. The semantic is similar to ByteBuffer#position().

Annotations
@Override
positionback to summary
public void position(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Doc from jdk.internal.net.http.quic.BuffersReader.position.

Sets the position of the reader. The semantic is similar to ByteBuffer#position(int).

Annotations
@Override
readback to summary
public long read()

Implements abstract jdk.internal.net.http.quic.BuffersReader.read.

Doc from jdk.internal.net.http.quic.BuffersReader.read.

Returns the cumulated amount of data that has been read in this BuffersReader since its creation. This number is not reset when calling release().

Annotations
@Override
releaseback to summary
public void release()

Implements abstract jdk.internal.net.http.quic.BuffersReader.release.

Doc from jdk.internal.net.http.quic.BuffersReader.release.

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

Annotations
@Override
jdk.internal.net.http.quic back to summary

public final Class BuffersReader.SingleBufferReader

extends BuffersReader
Class Inheritance

A lightweight view allowing to see a ByteBuffer as a BuffersReader. This class wrap a single ByteBuffer and cannot be reused after release().

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv ByteBuffer
pack-priv long

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
public void
clear()

Implements abstract jdk.internal.net.http.quic.BuffersReader.clear.

Release all buffers held by this BuffersReader, whether consumed or unconsumed.

public byte
get()

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Reads one byte from the reader.

public byte
get(long position)

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Reads the byte located at the given position in the reader.

public List<ByteBuffer>
getAndRelease(long bytes)

Implements abstract jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data.

public ByteBuffer

Returns:

a buffer containing the next bytes.
getAndReleaseBuffer
(long bytes)

This method has the same semantics than getAndRelease(long) except that it avoids creating a list.

public boolean
hasRemaining()

Overrides jdk.internal.net.http.quic.BuffersReader.hasRemaining.

Returns true if the reader has remaining bytes to the read.

public boolean
isEmpty()

Implements abstract jdk.internal.net.http.quic.BuffersReader.isEmpty.

Returns true if this BuffersReader is empty.

public long
limit()

Implements abstract jdk.internal.net.http.quic.BuffersReader.limit.

Returns the limit of the reader.

public long
offset()

Implements abstract jdk.internal.net.http.quic.BuffersReader.offset.

Returns The offset of this BuffersReader.

public long
position()

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Returns the current position of the reader.

public void
position(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Sets the position of the reader.

public long
read()

Implements abstract jdk.internal.net.http.quic.BuffersReader.read.

Returns the cumulated amount of data that has been read in this BuffersReader since its creation.

public void
release()

Implements abstract jdk.internal.net.http.quic.BuffersReader.release.

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

Inherited from jdk.internal.net.http.quic.BuffersReader:
listlistlistremainingsingle

Field Detail

readback to summary
pack-priv long read
singleback to summary
pack-priv ByteBuffer single
startback to summary
pack-priv long start

Constructor Detail

SingleBufferReaderback to summary
pack-priv SingleBufferReader(ByteBuffer single)

Method Detail

clearback to summary
public void clear()

Implements abstract jdk.internal.net.http.quic.BuffersReader.clear.

Doc from jdk.internal.net.http.quic.BuffersReader.clear.

Release all buffers held by this BuffersReader, whether consumed or unconsumed. Released buffer are all set to their limit.

Annotations
@Override
getback to summary
public byte get()

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Doc from jdk.internal.net.http.quic.BuffersReader.get.

Reads one byte from the reader. This method increase the position by one. The semantic is similar to ByteBuffer#get().

Annotations
@Override
getback to summary
public byte get(long position)

Implements abstract jdk.internal.net.http.quic.BuffersReader.get.

Doc from jdk.internal.net.http.quic.BuffersReader.get.

Reads the byte located at the given position in the reader. The semantic is similar to ByteBuffer#get(int). This method doesn't change the position of the reader.

Annotations
@Override
getAndReleaseback to summary
public List<ByteBuffer> getAndRelease(long bytes)

Implements abstract jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Doc from jdk.internal.net.http.quic.BuffersReader.getAndRelease.

Returns a list of ByteBuffer containing the requested amount of bytes, starting at the current position, then release all the data up to the new position, and reset the reader's position to 0 and the reader's limit to the amount of remaining data. .

Annotations
@Override
getAndReleaseBufferback to summary
public ByteBuffer getAndReleaseBuffer(long bytes)

This method has the same semantics than getAndRelease(long) except that it avoids creating a list.

Returns:ByteBuffer

a buffer containing the next bytes.

hasRemainingback to summary
public boolean hasRemaining()

Overrides jdk.internal.net.http.quic.BuffersReader.hasRemaining.

Doc from jdk.internal.net.http.quic.BuffersReader.hasRemaining.

Returns true if the reader has remaining bytes to the read. The semantic is similar to ByteBuffer#hasRemaining().

Annotations
@Override
isEmptyback to summary
public boolean isEmpty()

Implements abstract jdk.internal.net.http.quic.BuffersReader.isEmpty.

Doc from jdk.internal.net.http.quic.BuffersReader.isEmpty.

Returns true if this BuffersReader is empty. A BuffersReader is empty if it has been {@linkplain #list() created empty, or if it has been released after all data has been read.

Annotations
@Override
limitback to summary
public long limit()

Implements abstract jdk.internal.net.http.quic.BuffersReader.limit.

Doc from jdk.internal.net.http.quic.BuffersReader.limit.

Returns the limit of the reader. The semantic is similar to ByteBuffer#limit().

Annotations
@Override
offsetback to summary
public long offset()

Implements abstract jdk.internal.net.http.quic.BuffersReader.offset.

Doc from jdk.internal.net.http.quic.BuffersReader.offset.

Returns The offset of this BuffersReader. This is the position in the first ByteBuffer that was set on the reader. The BuffersReader will not allow to get or set a position lower than the offset.

Annotations
@Override
positionback to summary
public long position()

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Doc from jdk.internal.net.http.quic.BuffersReader.position.

Returns the current position of the reader. The semantic is similar to ByteBuffer#position().

Annotations
@Override
positionback to summary
public void position(long pos)

Implements abstract jdk.internal.net.http.quic.BuffersReader.position.

Doc from jdk.internal.net.http.quic.BuffersReader.position.

Sets the position of the reader. The semantic is similar to ByteBuffer#position(int).

Annotations
@Override
readback to summary
public long read()

Implements abstract jdk.internal.net.http.quic.BuffersReader.read.

Doc from jdk.internal.net.http.quic.BuffersReader.read.

Returns the cumulated amount of data that has been read in this BuffersReader since its creation. This number is not reset when calling release().

Annotations
@Override
releaseback to summary
public void release()

Implements abstract jdk.internal.net.http.quic.BuffersReader.release.

Doc from jdk.internal.net.http.quic.BuffersReader.release.

Releases all the data that has been read, sets the reader's position to 0 and its limit to the amount of data remaining.

Annotations
@Override