Package org.apache.hc.client5.http.utils
Class ByteArrayBuilder
java.lang.Object
org.apache.hc.client5.http.utils.ByteArrayBuilder
Builder class for sequences of bytes.
- Since:
- 5.0
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappend
(byte[] b) append
(byte[] b, int off, int len) append
(char[] b) append
(char[] b, int off, int len) append
(CharBuffer charBuffer) int
capacity()
private void
doAppend
(CharBuffer charBuffer) (package private) static ByteBuffer
encode
(ByteBuffer buffer, CharBuffer in, CharsetEncoder encoder) void
ensureFreeCapacity
(int freeCapacity) (package private) static ByteBuffer
ensureFreeCapacity
(ByteBuffer buffer, int capacity) void
reset()
byte[]
toString()
-
Field Details
-
charsetEncoder
-
buffer
-
-
Constructor Details
-
ByteArrayBuilder
public ByteArrayBuilder() -
ByteArrayBuilder
public ByteArrayBuilder(int initialCapacity)
-
-
Method Details
-
capacity
public int capacity() -
ensureFreeCapacity
-
encode
static ByteBuffer encode(ByteBuffer buffer, CharBuffer in, CharsetEncoder encoder) throws CharacterCodingException - Throws:
CharacterCodingException
-
ensureFreeCapacity
public void ensureFreeCapacity(int freeCapacity) -
doAppend
-
charset
-
append
-
append
-
append
-
append
-
append
-
append
-
toByteBuffer
-
toByteArray
public byte[] toByteArray() -
reset
public void reset() -
toString
-