public class UTF8StringInterner extends AbstractInterner<String>
This class extends AbstractInterner and overrides its getValue method to intern
strings encoded in UTF-8 format represented in BytesStore.
entries, mask, shift, toggle| Constructor and Description |
|---|
UTF8StringInterner(int capacity)
Constructs a new UTF8StringInterner with the specified capacity.
|
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull String |
getValue(@NotNull BytesStore<?,?> cs,
int length)
Converts the bytes from a
BytesStore into a UTF-8 encoded string. |
intern, intern, intern, intern, toggle, valueCountpublic UTF8StringInterner(int capacity)
capacity - the maximum number of items that the interner can hold.@NotNull protected @NotNull String getValue(@NotNull @NotNull BytesStore<?,?> cs, int length) throws UTFDataFormatRuntimeException, IllegalStateException, BufferUnderflowException
BytesStore into a UTF-8 encoded string.
The bytes are assumed to be in UTF-8 format and are decoded accordingly.getValue in class AbstractInterner<String>cs - the BytesStore containing the bytes to be convertedlength - the number of bytes to read from the BytesStoreUTFDataFormatRuntimeException - If the bytes are not valid UTF-8 encoded charactersBufferUnderflowException - If the buffer's limits are exceedednet.openhft.chronicle.core.io.ClosedIllegalStateException - If the resource has been released or closed.net.openhft.chronicle.core.io.ThreadingIllegalStateException - If this resource was accessed by multiple threads in an unsafe wayIllegalStateExceptionCopyright © 2024. All rights reserved.