public final class Utf8String extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
clear() |
Utf8String |
copyFrom(CharSequence other)
Holds on to immutable Strings and lazily encodes them, or
encodes the sequence directly if it is not a String.
|
Utf8String |
copyFrom(String other)
Holds on to the reference of the String and encodes it when required.
|
Utf8String |
copyFrom(Utf8String other) |
Utf8String |
copyFromEncoded(CharSequence other)
Encodes the sequence immediately and does not hold on to the reference
|
Utf8String |
copyFromUtf8(byte[] bytes) |
Utf8String |
copyFromUtf8(byte[] bytes,
int offset,
int length) |
void |
ensureCapacity(int minimumCapacity)
Ensures that the capacity is at least equal to the specified minimum.
|
Utf8String |
ensureSerialized()
Makes sure that the content is in serialized form.
|
boolean |
equals(Object o) |
StringBuilder |
getChars(StringBuilder store) |
String |
getString() |
String |
getString(Utf8Decoder decoder) |
int |
hashCode()
Utf8Strings have no immutable state and should not
be used in hashing structures.
|
static Utf8String |
newEmptyInstance() |
static Utf8String |
newEncodedInstance(CharSequence initialValue) |
static Utf8String |
newInstance(String initialValue) |
int |
size() |
String |
toString() |
Utf8String |
writeTo(ByteBuffer buffer) |
Utf8String |
writeTo(OutputStream outputStream) |
Utf8String |
writeTo(ProtoSink sink) |
public static Utf8String newEmptyInstance()
public static Utf8String newInstance(String initialValue)
public static Utf8String newEncodedInstance(CharSequence initialValue)
public int size()
public Utf8String ensureSerialized()
public String getString()
public String getString(Utf8Decoder decoder)
public StringBuilder getChars(StringBuilder store)
public Utf8String copyFrom(CharSequence other)
public Utf8String copyFromUtf8(byte[] bytes)
public Utf8String copyFromUtf8(byte[] bytes, int offset, int length)
public Utf8String copyFromEncoded(CharSequence other)
public Utf8String copyFrom(String other)
public Utf8String copyFrom(Utf8String other)
public Utf8String writeTo(ProtoSink sink) throws IOException
IOExceptionpublic Utf8String writeTo(OutputStream outputStream) throws IOException
IOExceptionpublic Utf8String writeTo(ByteBuffer buffer)
public void clear()
public final int hashCode()
public void ensureCapacity(int minimumCapacity)
minimumCapacity argument.
2.
minimumCapacity argument is nonpositive, this
method takes no action and simply returns.
Note that subsequent operations on this object can reduce the
actual capacity below that requested here.minimumCapacity - the minimum desired capacity.Copyright © 2019–2024 HEBI Robotics. All rights reserved.