public class StringInternerBytes
extends net.openhft.chronicle.core.pool.StringInterner
StringInterner
and is specifically
designed to handle interning of strings represented in Bytes
objects.Constructor and Description |
---|
StringInternerBytes(int capacity)
Constructs a new
StringInternerBytes instance with the specified capacity. |
Modifier and Type | Method and Description |
---|---|
String |
intern(@NotNull Bytes<?> bytes)
Interns the string representation of the given bytes.
|
String |
intern(@NotNull Bytes<?> bytes,
int length)
Converts the given bytes to an ISO-8859-1 encoded string, and interns it.
|
public StringInternerBytes(int capacity) throws IllegalArgumentException
StringInternerBytes
instance with the specified capacity.capacity
- the number of strings that can be stored in the interner.IllegalArgumentException
- if the specified capacity is negative.public String intern(@NotNull @NotNull Bytes<?> bytes) throws ArithmeticException, IllegalStateException, BufferUnderflowException
bytes
- the bytes to be converted and interned as a string.ArithmeticException
- if there is an integer overflow when calculating the length.IllegalStateException
- if the underlying bytes store is not readable.BufferUnderflowException
- if there are not enough bytes remaining to read.public String intern(@NotNull @NotNull Bytes<?> bytes, int length) throws IllegalStateException, BufferUnderflowException
bytes
- the bytes to convert to a string.length
- specifies the maximum number of bytes to be converted, must be non-negative.IllegalArgumentException
- if length is negative.IllegalStateException
- if the underlying bytes store is not readable.BufferUnderflowException
- if there are not enough bytes remaining to read.Copyright © 2023. All rights reserved.