java.lang.Object | |
↳ | org.apache.http.util.CharArrayBuffer |
A resizable char array.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates an instance of
CharArrayBuffer with the given initial
capacity. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Appends
len chars to this buffer from the given source
array starting at index off . | |||||||||||
Appends chars of the given string to this buffer.
| |||||||||||
Appends
len bytes to this buffer from the given source
array starting at index off . | |||||||||||
Appends
ch char to this buffer. | |||||||||||
Appends chars of the textual representation of the given object to this
buffer.
| |||||||||||
Appends
len chars to this buffer from the given source
buffer starting at index off . | |||||||||||
Appends all chars to this buffer from the given source buffer starting
at index
0 . | |||||||||||
Appends
len bytes to this buffer from the given source
array starting at index off . | |||||||||||
Returns reference to the underlying char array.
| |||||||||||
Returns the current capacity.
| |||||||||||
Returns the
char value in this buffer at the specified
index. | |||||||||||
Clears content of the buffer.
| |||||||||||
Ensures that the capacity is at least equal to the specified minimum.
| |||||||||||
Returns the index within this buffer of the first occurrence of the
specified character, starting the search at the specified
beginIndex and finishing at endIndex . | |||||||||||
Returns the index within this buffer of the first occurrence of the
specified character, starting the search at
0 and finishing
at length() . | |||||||||||
Returns the length of the buffer (char count).
| |||||||||||
Sets the length of the buffer.
| |||||||||||
Returns a substring of this buffer.
| |||||||||||
Returns a substring of this buffer with leading and trailing whitespace
omitted.
| |||||||||||
Converts the content of this buffer to an array of chars.
| |||||||||||
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates an instance of CharArrayBuffer
with the given initial
capacity.
capacity | the capacity |
---|
Appends len
chars to this buffer from the given source
array starting at index off
. The capacity of the buffer
is increased, if necessary, to accommodate all len
chars.
b | the chars to be appended. |
---|---|
off | the index of the first char to append. |
len | the number of chars to append. |
IndexOutOfBoundsException | if off is out of
range, len is negative, or
off + len is out of range.
|
---|
Appends chars of the given string to this buffer. The capacity of the buffer is increased, if necessary, to accommodate all chars.
str | the string. |
---|
Appends len
bytes to this buffer from the given source
array starting at index off
. The capacity of the buffer
is increased, if necessary, to accommodate all len
bytes.
The bytes are converted to chars using simple cast.
b | the bytes to be appended. |
---|---|
off | the index of the first byte to append. |
len | the number of bytes to append. |
IndexOutOfBoundsException | if off is out of
range, len is negative, or
off + len is out of range.
|
---|
Appends ch
char to this buffer. The capacity of the buffer
is increased, if necessary, to accommodate the additional char.
ch | the char to be appended. |
---|
Appends chars of the textual representation of the given object to this buffer. The capacity of the buffer is increased, if necessary, to accommodate all chars.
obj | the object. |
---|
Appends len
chars to this buffer from the given source
buffer starting at index off
. The capacity of the
destination buffer is increased, if necessary, to accommodate all
len
chars.
b | the source buffer to be appended. |
---|---|
off | the index of the first char to append. |
len | the number of chars to append. |
IndexOutOfBoundsException | if off is out of
range, len is negative, or
off + len is out of range.
|
---|
Appends all chars to this buffer from the given source buffer starting
at index 0
. The capacity of the destination buffer is
increased, if necessary, to accommodate all length()
chars.
b | the source buffer to be appended. |
---|
Appends len
bytes to this buffer from the given source
array starting at index off
. The capacity of the buffer
is increased, if necessary, to accommodate all len
bytes.
The bytes are converted to chars using simple cast.
b | the bytes to be appended. |
---|---|
off | the index of the first byte to append. |
len | the number of bytes to append. |
IndexOutOfBoundsException | if off is out of
range, len is negative, or
off + len is out of range.
|
---|
Returns reference to the underlying char array.
Returns the current capacity. The capacity is the amount of storage available for newly appended chars, beyond which an allocation will occur.
Returns the char
value in this buffer at the specified
index. The index argument must be greater than or equal to
0
, and less than the length of this buffer.
i | the index of the desired char value. |
---|
IndexOutOfBoundsException | if index is
negative or greater than or equal to length() .
|
---|
Clears content of the buffer. The underlying char array is not resized.
Ensures that the capacity is at least equal to the specified minimum.
If the current capacity is less than the argument, then a new internal
array is allocated with greater capacity. If the required
argument is non-positive, this method takes no action.
required | the minimum required capacity. |
---|
Returns the index within this buffer of the first occurrence of the
specified character, starting the search at the specified
beginIndex
and finishing at endIndex
.
If no such character occurs in this buffer within the specified bounds,
-1
is returned.
There is no restriction on the value of beginIndex
and
endIndex
. If beginIndex
is negative,
it has the same effect as if it were zero. If endIndex
is
greater than length()
, it has the same effect as if it were
length()
. If the beginIndex
is greater than
the endIndex
, -1
is returned.
ch | the char to search for. |
---|---|
beginIndex | the index to start the search from. |
endIndex | the index to finish the search at. |
-1
if the character does
not occur.
Returns the index within this buffer of the first occurrence of the
specified character, starting the search at 0
and finishing
at length()
. If no such character occurs in this buffer within
those bounds, -1
is returned.
ch | the char to search for. |
---|
-1
if the character does not occur.
Returns true
if this buffer is empty, that is, its
length()
is equal to 0
.
true
if this buffer is empty, false
otherwise.
Returns true
if this buffer is full, that is, its
length()
is equal to its capacity()
.
true
if this buffer is full, false
otherwise.
Returns the length of the buffer (char count).
Sets the length of the buffer. The new length value is expected to be
less than the current capacity and greater than or equal to
0
.
len | the new length |
---|
IndexOutOfBoundsException | if the
len argument is greater than the current
capacity of the buffer or less than 0 .
|
---|
Returns a substring of this buffer. The substring begins at the specified
beginIndex
and extends to the character at index
endIndex - 1
.
beginIndex | the beginning index, inclusive. |
---|---|
endIndex | the ending index, exclusive. |
StringIndexOutOfBoundsException | if the
beginIndex is negative, or
endIndex is larger than the length of this
buffer, or beginIndex is larger than
endIndex .
|
---|
Returns a substring of this buffer with leading and trailing whitespace
omitted. The substring begins with the first non-whitespace character
from beginIndex
and extends to the last
non-whitespace character with the index lesser than
endIndex
.
beginIndex | the beginning index, inclusive. |
---|---|
endIndex | the ending index, exclusive. |
IndexOutOfBoundsException | if the
beginIndex is negative, or
endIndex is larger than the length of this
buffer, or beginIndex is larger than
endIndex .
|
---|
Converts the content of this buffer to an array of chars.