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

public final Class PeerConnectionId

extends QuicConnectionId
Class Inheritance
Imports
java.nio.ByteBuffer, java.util.HexFormat

A free-form connection ID to wrap the connection ID bytes sent by the peer. Client and server might impose some structure on the connection ID bytes. For instance, they might choose to encode the connection ID length in the connection ID bytes. This class makes no assumption on the structure of the connection id bytes.

Field Summary

Modifier and TypeField and Description
private final byte[]
Inherited from jdk.internal.net.http.quic.QuicConnectionId:
bufhashCodeMAX_CONNECTION_ID_LENGTH

Constructor Summary

AccessConstructor and Description
public
PeerConnectionId(final byte[]
The connection ID bytes.
connId
)

A new QuicConnectionId represented by the given bytes.

public
PeerConnectionId(final ByteBuffer
The connection ID bytes.
connId
,
final byte[]
The stateless reset token to be associated with this connection id. Can be null.
statelessResetToken
)

A new QuicConnectionId represented by the given bytes.

Method Summary

Modifier and TypeMethod and Description
private static ByteBuffer
public byte[]

Returns:

the stateless reset token associated with this connection id. returns null if no token exists
getStatelessResetToken
()

Returns the stateless reset token associated with this connection id. returns null if no token exists.

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from jdk.internal.net.http.quic.QuicConnectionId:
asReadOnlyBuffercompareBytescompareToequalsgetByteshashCodelengthmatchestoHexString

Field Detail

statelessResetTokenback to summary
private final byte[] statelessResetToken

Constructor Detail

PeerConnectionIdback to summary
public PeerConnectionId(final byte[] connId)

A new QuicConnectionId represented by the given bytes.

Parameters
connId:byte[]

The connection ID bytes.

PeerConnectionIdback to summary
public PeerConnectionId(final ByteBuffer connId, final byte[] statelessResetToken)

A new QuicConnectionId represented by the given bytes.

Parameters
connId:ByteBuffer

The connection ID bytes.

statelessResetToken:byte[]

The stateless reset token to be associated with this connection id. Can be null.

Exceptions
IllegalArgumentException:
If the statelessResetToken is non-null and if its length isn't 16 bytes

Method Detail

cloneBufferback to summary
private static ByteBuffer cloneBuffer(ByteBuffer src)
getStatelessResetTokenback to summary
public byte[] getStatelessResetToken()

Returns the stateless reset token associated with this connection id. returns null if no token exists.

Returns:byte[]

the stateless reset token associated with this connection id. returns null if no token exists

toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override