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.BufferUnderflowException
- If there are not enough bytes remaining to read.net.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 wayIllegalStateException
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.BufferUnderflowException
- If there are not enough bytes remaining to read.net.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 wayIllegalStateException
Copyright © 2024. All rights reserved.