public class UTF8StringInterner extends AbstractInterner<String>
AbstractInterner implementation for interning String objects
decoded from UTF-8 byte sequences within a BytesStore.
Example usage:
UTF8StringInterner interner = new UTF8StringInterner(256);
String s = interner.intern(store, length);
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)
Decodes a UTF-8 string from the supplied
BytesStore. |
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. Exactly
length bytes are read starting from cs.readPosition() and
the read position is left unchanged.getValue in class AbstractInterner<String>cs - the bytes store containing UTF-8 datalength - the number of bytes to readUTFDataFormatRuntimeException - 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 © 2026 Chronicle Software Ltd. All rights reserved.