public class BytesPool extends Object
Bytes
instances.
This class uses a ThreadLocal
to store a single Bytes
instance per thread,
which can be reused to avoid the overhead of creating a new instance every time bytes are
needed for operations.
This class is primarily meant to be used in high-performance environments where reducing object creation is crucial.
Constructor and Description |
---|
BytesPool() |
Modifier and Type | Method and Description |
---|---|
Bytes<?> |
acquireBytes()
Acquires a
Bytes instance from the thread-local pool. |
protected @NotNull Bytes<?> |
createBytes()
Creates a new
Bytes instance. |
Copyright © 2023. All rights reserved.