Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
gnu.javax.net.ssl.provider.ExtensionList
ClientHello
or
ServerHello
. The form of the extensions list is:
Extension extensions_list<1..2^16-1>
Nested Class Summary | |
class |
|
Constructor Summary | |
| |
|
Method Summary | |
ByteBuffer |
|
Extension |
|
Iterator |
|
int |
|
void | |
void |
|
void |
|
int |
|
String |
|
String |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public ByteBuffer buffer()
Returns the final buffer, possibly containing the built object. The returned buffer will be "trimmed" to size: its position will be zero, and its limit and capacity set to the length of the built object.
- Returns:
- The underlying buffer.
public int length()
Returns the length of this extension list, in bytes.
- Specified by:
- length in interface Constructed
- Returns:
- The length of this extension list, in bytes.
public void set(int index, Extension e)
Sets the extension at index i to e. Note that setting an element at an index may invalidate any other elements that come after element at index i. In other words, no attempt is made to move existing elements in this list, and since extensions are variable length, you can not guarantee that extensions later in the list will still be valid. Thus, elements of this list must be set in order of increasing index.
- Parameters:
index
- The index to set the extension at.e
- The extension.
- Throws:
BufferOverflowException
- If setting the extension overflows the buffer.IllegalArgumentException
- If it isn't possible to find the given index in the current list (say, if no element index - 1 is set), or if setting the extension will overflow the current list length (given bylength()
).
public void set(int index, Extension.Type t, int eLength)
Reserve space for an extension at index i in the list. In other words, this does the job ofset(int,Extension)
, but does not copy the extension value to the underlying buffer.
- Parameters:
index
- The index of the extension to reserve space for.t
- The type of the extension.eLength
- The number of bytes to reserve for this extension. The total number of bytes used by this method is this length, plus four.
public void setLength(int newLength)
Set the total length of this list, in bytes.
- Parameters:
newLength
- The new list length.
public int size()
Returns the number of extensions this list contains.
- Returns:
- The number of extensions.
public String toString()
Convert this Object to a human-readable String. There are no limits placed on how long this String should be or what it should contain. We suggest you make it as intuitive as possible to be able to place it intoSystem.out.println()
and such. It is typical, but not required, to ensure that this method never completes abruptly with aRuntimeException
. This method will be called when performing string concatenation with this object. If the result isnull
, string concatenation will instead use"null"
. The default implementation returnsgetClass().getName() + "@" + Integer.toHexString(hashCode())
.
- Returns:
- the String representing this Object, which may be null
- See Also:
getClass()
,Object.hashCode()
,Class.getName()
,Integer.toHexString(int)
public String toString(String prefix)
Returns a printable representation of this structure, with the given prefix prepended to each line.
- Specified by:
- toString in interface Constructed
- Parameters:
prefix
- The prefix to prepend to each line of the output. This value may benull
.
- Returns:
- A printable representation of this structure.