| Package | Description |
|---|---|
| net.openhft.chronicle.bytes |
The Chronicle Bytes package provides low-level memory access wrappers with functionalities
akin to Java NIO's ByteBuffer.
|
| net.openhft.chronicle.bytes.algo |
Provides classes for hash computations on ByteStore objects.
|
| net.openhft.chronicle.bytes.internal | |
| net.openhft.chronicle.bytes.ref |
Provides classes and interfaces for handling references to arrays of
various primitive types with byte representation.
|
| net.openhft.chronicle.bytes.util |
Provides utility classes and interfaces for Chronicle Bytes.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
BytesStore<B extends BytesStore<B,U>,U>
This interface represents an immutable reference to a segment of bytes with a fixed range.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
Bytes<U>
The
Bytes class is a versatile container for raw byte data, providing rich functionality to read and write
data in various formats including integers, longs, floating-point values, strings, and more. |
| Modifier and Type | Class and Description |
|---|---|
class |
AbstractBytes<U>
Abstract representation of Bytes.
|
class |
GuardedNativeBytes<U>
This class extends the
NativeBytes class and provides an additional layer of safety by tracking the raw primitives written to the byte buffer. |
class |
HexDumpBytes
A class that implements the
Bytes interface for generating a hex dump of byte data. |
class |
MappedBytes
A specialized implementation of
AbstractBytes that wraps memory-mapped data for efficient random file access. |
class |
MappedBytesStore
A BytesStore implementation that wraps memory-mapped data.
|
class |
NativeBytes<U>
NativeBytes is a subclass of VanillaBytes which can wrap either a ByteBuffer or malloc'ed memory.
|
class |
OnHeapBytes |
class |
PointerBytesStore
A BytesStore that points to arbitrary memory.
|
class |
SubBytes<U>
A
SubBytes object represents a subsection of a BytesStore from a given start index up to a specified capacity. |
class |
UncheckedBytes<U>
An optimized extension of AbstractBytes that doesn't perform any bounds checking
for read and write operations.
|
class |
UncheckedNativeBytes<U>
An optimized extension of AbstractBytes that performs unchecked read and write operations
on a Bytes instance that is backed by native memory.
|
class |
VanillaBytes<U>
A simple Bytes implementation that is non-elastic.
|
| Modifier and Type | Field and Description |
|---|---|
protected @NotNull BytesStore<?,U> |
UncheckedNativeBytes.bytesStore |
protected @NotNull BytesStore<?,U> |
AbstractBytes.bytesStore |
| Modifier and Type | Method and Description |
|---|---|
static <B extends BytesStore<B,T>,T> |
BytesStore.empty()
Provides an empty, fixed-sized and immutable BytesStore.
|
static <A extends BytesStore<A,B>,B> |
BytesStore.from(@NotNull BytesStore<A,B> cs)
Returns a BytesStore using the bytes in another specified BytesStore.
|
| Modifier and Type | Method and Description |
|---|---|
@Nullable BytesStore<?,?> |
Byteable.bytesStore()
Returns the ByteStore to which this object currently points.
|
@NotNull BytesStore<?,Void> |
HexDumpBytes.bytesStore() |
@Nullable BytesStore<?,U> |
UncheckedNativeBytes.bytesStore() |
BytesStore<?,?> |
BytesRingBuffer.bytesStore()
Retrieves the BytesStore that backs this buffer.
|
default @Nullable BytesStore<?,?> |
BytesStore.bytesStore() |
@Nullable BytesStore<?,U> |
Bytes.bytesStore()
Returns the backing BytesStore that this Bytes object wraps.
|
@NotNull BytesStore<?,U> |
AbstractBytes.bytesStore() |
BytesStore<?,?> |
RingBufferReader.byteStore()
Retrieves the
BytesStore instance that backs the Ring Buffer. |
@NotNull BytesStore<Bytes<U>,U> |
VanillaBytes.copy() |
BytesStore<Bytes<Void>,Void> |
HexDumpBytes.copy() |
@NotNull BytesStore<Bytes<U>,U> |
UncheckedNativeBytes.copy() |
@NotNull BytesStore<Bytes<U>,U> |
UncheckedBytes.copy() |
BytesStore<B,U> |
BytesStore.copy()
Creates and returns a copy of this BytesStore.
|
BytesStore<Bytes<U>,U> |
Bytes.copy()
Creates and returns a deep copy of this Bytes object, including the data between
RandomCommon.readPosition() and RandomCommon.readLimit(). |
static BytesStore<?,ByteBuffer> |
BytesStore.elasticByteBuffer(int size,
long maxSize)
Creates a flexible ByteBuffer instance that resides in native memory.
|
static <B extends BytesStore<B,T>,T> |
BytesStore.empty()
Provides an empty, fixed-sized and immutable BytesStore.
|
static @NotNull BytesStore<?,ByteBuffer> |
BytesStore.follow(@NotNull ByteBuffer bb)
Wraps a ByteBuffer which can be either on heap or off heap without taking ownership of that buffer.
|
static <T> BytesStore<?,T> |
BytesStore.forFields(Object o,
String groupName,
int padding)
Provides a BytesStore that allows access to a group of fields in a given object.
|
static <A extends BytesStore<A,B>,B> |
BytesStore.from(@NotNull BytesStore<A,B> cs)
Returns a BytesStore using the bytes in another specified BytesStore.
|
static BytesStore<?,?> |
BytesStore.from(@NotNull CharSequence cs)
Converts a CharSequence into a BytesStore.
|
static BytesStore<?,byte[]> |
BytesStore.from(@NotNull String cs)
Converts a String into a BytesStore.
|
static BytesStore<?,Void> |
BytesStore.lazyNativeBytesStoreWithFixedCapacity(long capacity)
Creates a lazily initialized BytesStore instance with a fixed capacity that resides in native memory.
|
static BytesStore<?,Void> |
BytesStore.nativeStore(long capacity)
This is an elastic native store.
|
static BytesStore<?,Void> |
BytesStore.nativeStoreFrom(byte[] bytes)
Creates and returns a new BytesStore that resides in native memory whereby the contents and
size of the native memory is determined by the provided
bytes array. |
static BytesStore<?,Void> |
BytesStore.nativeStoreWithFixedCapacity(long capacity)
Creates a BytesStore instance with a fixed capacity that resides in native memory.
|
default @NotNull BytesStore<?,?> |
RandomDataInput.subBytes(long start,
long length)
Returns a new BytesStore that is a subsequence of this byte sequence, starting at the specified index and of the specified length.
|
static BytesStore<?,byte[]> |
BytesStore.wrap(byte[] bytes)
Wraps a byte array into a BytesStore.
|
static @NotNull BytesStore<?,ByteBuffer> |
BytesStore.wrap(@NotNull ByteBuffer bb)
Wraps a ByteBuffer into a BytesStore.
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull MappedBytesStore |
MappedFile.acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore<?,?> oldByteStore)
Acquires a byte store at the specified position with the ability to re-use an existing byte store.
|
abstract @NotNull MappedBytesStore |
MappedFile.acquireByteStore(net.openhft.chronicle.core.io.ReferenceOwner owner,
long position,
BytesStore<?,?> oldByteStore,
@NotNull MappedBytesStoreFactory mappedBytesStoreFactory)
Acquires a byte store at the specified position with the ability to re-use an existing byte store,
and specify a custom byte store factory.
|
default B |
ByteStringAppender.append8bit(@NotNull BytesStore<?,?> bs)
Appends the ISO-8859-1 representation of the specified BytesStore.
|
@NotNull Bytes<U> |
VanillaBytes.append8bit(@NotNull BytesStore<?,?> bs) |
Bytes<Void> |
HexDumpBytes.append8bit(@NotNull BytesStore<?,?> bs) |
default B |
ByteStringAppender.append8bit(@NotNull BytesStore<?,?> bs,
long start,
long end)
Appends a portion of a BytesStore to this in ISO-8859-1 format.
|
Bytes<Void> |
HexDumpBytes.append8bit(@NotNull BytesStore<?,?> bs,
long start,
long end) |
protected void |
GuardedNativeBytes.bytesStore(@NotNull BytesStore<?,U> bytesStore) |
protected void |
NativeBytes.bytesStore(@NotNull BytesStore<?,U> bytesStore) |
protected void |
AbstractBytes.bytesStore(BytesStore<?,U> bytesStore) |
void |
VanillaBytes.bytesStore(@NotNull BytesStore byteStore,
long offset,
long length) |
void |
Byteable.bytesStore(@NotNull BytesStore bytesStore,
long offset,
long length)
Sets the reference to a data type that points to the underlying ByteStore.
|
void |
NativeBytes.bytesStore(@NotNull BytesStore byteStore,
long offset,
long length) |
default boolean |
BytesStore.contentEquals(@Nullable BytesStore<?,?> bytesStore)
Returns if the content of this BytesStore is the same as the content of a specified BytesStore.
|
static void |
BytesUtil.copy8bit(BytesStore<?,?> bs,
long addressForWrite,
long length)
Copies 8-bit data from a BytesStore object to a specified address.
|
long |
StreamingDataInput.copyTo(@NotNull BytesStore<?,?> to)
Copies the data from the input stream to the provided BytesStore.
|
default long |
BytesStore.copyTo(@NotNull BytesStore<?,?> store)
Returns the number of bytes that were copied from this BytesStore to a destination BytesStore.
|
default long |
Bytes.copyTo(@NotNull BytesStore<?,?> targetByteStore)
Copies bytes from this Bytes object into the provided
targetByteStore. |
boolean |
VanillaBytes.equalBytes(@NotNull BytesStore<?,?> bytesStore,
long length) |
default boolean |
BytesStore.equalBytes(@NotNull BytesStore<?,?> bytesStore,
long length)
Returns if a portion of a specified BytesStore matches this BytesStore.
|
static <A extends BytesStore<A,B>,B> |
BytesStore.from(@NotNull BytesStore<A,B> cs)
Returns a BytesStore using the bytes in another specified BytesStore.
|
default int |
Bytes.indexOf(@NotNull BytesStore<?,?> source,
int fromIndex)
Returns the lowest index value starting from the provided
fromIndex for which the contents of this
Bytes object equals the provided source , or -1 if no such index value exists. |
protected static <T> long |
NativeBytes.maxCapacityFor(@NotNull BytesStore<?,T> bs) |
static @NotNull BytesRingBuffer |
BytesRingBuffer.newInstance(@NotNull BytesStore<?,Void> bytesStore)
Constructs a new instance with the provided
BytesStore. |
static @NotNull MultiReaderBytesRingBuffer |
BytesRingBuffer.newInstance(@NotNull BytesStore<?,Void> bytesStore,
int numReaders)
Constructs a new
MultiReaderBytesRingBuffer instance with the provided BytesStore and a given number of readers. |
boolean |
BytesRingBuffer.offer(@NotNull BytesStore<?,?> bytes0)
Inserts the specified element at the tail of this queue if it is possible to do so
immediately without exceeding the queue's capacity,
|
static void |
AppendableUtil.parseUtf8(@NotNull BytesStore<?,?> bs,
StringBuilder sb,
boolean utf,
int length)
Parses a UTF-8 BytesStore into a StringBuilder.
|
B |
BytesPrepender.prewrite(BytesStore<?,?> bytes)
Writes a BytesStore instance backward in binary format.
|
@NotNull Bytes<Void> |
HexDumpBytes.prewrite(BytesStore<?,?> bytes) |
@NotNull Bytes<U> |
UncheckedNativeBytes.prewrite(@NotNull BytesStore<?,?> bytes) |
@NotNull Bytes<U> |
AbstractBytes.prewrite(@NotNull BytesStore<?,?> bytes) |
default boolean |
BytesStore.startsWith(@Nullable BytesStore<?,?> bytesStore)
Returns if the content of this BytesStore starts with bytes equal to the content of a specified BytesStore.
|
boolean |
AbstractBytes.startsWith(@Nullable BytesStore<?,?> bytesStore) |
static <U> VanillaBytes<U> |
VanillaBytes.wrap(BytesStore<?,U> bytesStore)
Factory method for creating an instance of VanillaBytes that wraps the provided BytesStore.
|
static <T> @NotNull NativeBytes<T> |
NativeBytes.wrapWithNativeBytes(@NotNull BytesStore<?,T> bs,
long capacity)
Wraps the provided BytesStore with a new instance of NativeBytes with the specified capacity.
|
default S |
StreamingDataOutput.write(@NotNull BytesStore<?,?> bytes)
Writes all available data from the specified
BytesStore into the output stream. |
Bytes<Void> |
HexDumpBytes.write(@NotNull BytesStore<?,?> bytes) |
Bytes<U> |
AbstractBytes.write(@NotNull BytesStore<?,?> bytes) |
default S |
StreamingDataOutput.write(@NotNull BytesStore<?,?> bytes,
long readOffset,
long length)
Writes the specified number of bytes from the provided
BytesStore into the output stream,
starting from the given read offset. |
@NotNull Bytes<U> |
VanillaBytes.write(@NotNull BytesStore<?,?> bytes,
long offset,
long length) |
@NotNull Bytes<Void> |
HexDumpBytes.write(@NotNull BytesStore<?,?> bytes,
long offset,
long length) |
@NotNull Bytes<U> |
UncheckedBytes.write(@NotNull BytesStore<?,?> bytes,
long offset,
long length) |
default R |
RandomDataOutput.write(long offsetInRDO,
@NotNull BytesStore<?,?> bytes)
Copies the entire content of the provided BytesStore into this data output.
|
Bytes<U> |
UncheckedNativeBytes.write8bit(@Nullable BytesStore<?,?> bs) |
@NotNull Bytes<U> |
AbstractBytes.write8bit(@Nullable BytesStore<?,?> bs) |
long |
RandomDataOutput.write8bit(long position,
@NotNull BytesStore<?,?> bs)
Writes a BytesStore instance to this RandomDataOutput at the given position.
|
long |
HexDumpBytes.write8bit(long position,
@NotNull BytesStore<?,?> bs) |
long |
UncheckedNativeBytes.write8bit(long position,
@NotNull BytesStore<?,?> bs) |
long |
AbstractBytes.write8bit(long position,
@NotNull BytesStore<?,?> bs) |
static long |
BytesUtil.writeStopBit(BytesStore<?,?> bs,
long offset,
long n)
Writes a variable-length integer to a specific position in a BytesStore using the stop bit encoding.
|
default void |
StreamingDataOutput.writeWithLength(@NotNull BytesStore<?,?> bytes)
Writes data from the provided RandomDataInput into this Bytes object with prefixed length.
|
void |
HexDumpBytes.writeWithLength(@NotNull BytesStore<?,?> bytes) |
| Constructor and Description |
|---|
GuardedNativeBytes(@NotNull BytesStore<?,?> store,
long capacity)
Constructs a new GuardedNativeBytes instance backed by the specified BytesStore and with the specified capacity.
|
NativeBytes(@NotNull BytesStore<?,?> store)
Constructs a new instance of NativeBytes with the specified BytesStore and the store's capacity.
|
NativeBytes(@NotNull BytesStore<?,?> store,
long capacity)
Constructs a new instance of NativeBytes with the specified BytesStore and capacity.
|
OnHeapBytes(@NotNull BytesStore<?,?> bytesStore,
boolean elastic)
Constructs an instance of OnHeapBytes using the provided BytesStore.
|
SubBytes(@NotNull BytesStore<?,?> bytesStore,
long start,
long capacity)
Class constructor.
|
VanillaBytes(@NotNull BytesStore<?,?> bytesStore)
Constructor for creating an instance of VanillaBytes with the given BytesStore,
using its write position and write limit.
|
VanillaBytes(@NotNull BytesStore<?,?> bytesStore,
long writePosition,
long writeLimit)
Constructor for creating an instance of VanillaBytes with the given BytesStore,
write position, and write limit.
|
| Modifier and Type | Interface and Description |
|---|---|
interface |
BytesStoreHash<B extends BytesStore>
Represents a function that computes a 64-bit hash value from a
BytesStore. |
| Modifier and Type | Method and Description |
|---|---|
long |
OptimisedBytesStoreHash.applyAsLong(@NotNull BytesStore<?,?> store)
Hashes a BytesStore.
|
long |
XxHash.applyAsLong(BytesStore<?,?> bytes)
Calculates the hash code of the given byte store.
|
long |
VanillaBytesStoreHash.applyAsLong(@NotNull BytesStore<?,?> store)
Computes a 64-bit hash value for the given BytesStore.
|
long |
BytesStoreHash.applyAsLong(BytesStore<?,?> bytes,
long length)
Computes a 64-bit hash value of the given
BytesStore with a specified length. |
long |
OptimisedBytesStoreHash.applyAsLong(@NotNull BytesStore<?,?> store,
long remaining)
Hashes a BytesStore of the given length.
|
long |
XxHash.applyAsLong(BytesStore<?,?> bytes,
long length)
Computes a hash value for the given byte store with a specified length.
|
long |
VanillaBytesStoreHash.applyAsLong(BytesStore<?,?> bytes,
long length)
Computes a 64-bit hash value for the given BytesStore.
|
static long |
OptimisedBytesStoreHash.applyAsLong32bytesMultiple(@NotNull BytesStore<?,?> store,
int remaining)
Computes a 64-bit hash value for the given BytesStore for data sizes that are multiple of 32 bytes.
|
static long |
OptimisedBytesStoreHash.applyAsLongAny(@NotNull BytesStore<?,?> store,
long remaining)
Computes a 64-bit hash value for the given BytesStore for any size of data.
|
static long |
BytesStoreHash.hash(@NotNull BytesStore<?,?> b)
Computes a 64-bit hash value of the given
BytesStore. |
static long |
BytesStoreHash.hash(@NotNull BytesStore<?,?> b,
long length)
Computes a 64-bit hash value of the given
BytesStore with a specified length. |
static int |
BytesStoreHash.hash32(BytesStore<?,?> b)
Computes a 32-bit hash value of the given
BytesStore. |
static int |
BytesStoreHash.hash32(@NotNull BytesStore<?,?> b,
int length)
Computes a 32-bit hash value of the given
BytesStore with a specified length. |
| Modifier and Type | Class and Description |
|---|---|
class |
net.openhft.chronicle.bytes.internal.AbstractBytesStore<B extends BytesStore<B,U>,U>
Abstract BytesStore
|
class |
net.openhft.chronicle.bytes.internal.NativeBytesStore<U> |
| Modifier and Type | Field and Description |
|---|---|
protected @Nullable BytesStore |
AbstractReference.bytesStore
BytesStore associated with this reference
|
| Modifier and Type | Method and Description |
|---|---|
@NotNull BytesStore<?,?> |
UncheckedLongReference.bytesStore() |
@Nullable BytesStore<?,?> |
AbstractReference.bytesStore() |
@Nullable BytesStore<?,?> |
BinaryIntArrayReference.bytesStore()
Retrieves the BytesStore.
|
@Nullable BytesStore<?,?> |
BinaryLongArrayReference.bytesStore() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
AbstractReference.acceptNewBytesStore(@NotNull BytesStore<?,?> bytes)
Updates the BytesStore for this reference, releasing any previous BytesStore
|
protected void |
BinaryIntArrayReference.acceptNewBytesStore(@NotNull BytesStore<?,?> bytes)
Assigns a new BytesStore to this BinaryIntArrayReference.
|
protected void |
BinaryLongArrayReference.acceptNewBytesStore(@NotNull BytesStore<?,?> bytes) |
void |
UncheckedLongReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Associates this
UncheckedLongReference with a BytesStore, specifying where the long value is stored and its length. |
void |
BinaryBooleanReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
void |
AbstractReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the underlying BytesStore to work with, along with the offset and length.
|
void |
TextLongArrayReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length) |
void |
BinaryIntArrayReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Stores a bytes sequence into the BinaryIntArrayReference.
|
void |
BinaryIntReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Sets the BytesStore which this reference points to.
|
void |
BinaryLongReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Stores bytes from the given BytesStore into this BinaryLongReference.
|
void |
BinaryLongArrayReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length) |
void |
TextIntArrayReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length) |
void |
TextLongReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length)
Configures the byte store for this reference.
|
void |
TextIntReference.bytesStore(@NotNull BytesStore bytes,
long offset,
long length) |
static @NotNull LongReference |
UncheckedLongReference.create(@NotNull BytesStore<?,?> bytesStore,
long offset,
int size)
Factory method to create a
UncheckedLongReference or BinaryLongReference based on the JVM's debug status. |
static long |
TextLongArrayReference.peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Estimates the length of the text wire format structure for the long array
based on the current state of the given
BytesStore. |
static long |
BinaryIntArrayReference.peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Calculates and returns the peak length from the BytesStore at the given offset.
|
static long |
BinaryLongArrayReference.peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Returns the capacity from the BytesStore object and adding the fixed values size to get a length.
|
static long |
TextIntArrayReference.peakLength(@NotNull BytesStore<?,?> bytes,
long offset)
Determines the length of the array in the text format represented in the given
BytesStore. |
static long |
BinaryLongArrayReference.peakLength(@NotNull BytesStore<?,?> bytes,
long offset,
long capacityHint)
Returns the capacity from the BytesStore object, adding the fixed values size to get a length
If the read capacity is 0, the method writes the capacityHint at the offset and
updates the capacity with the capacityHint.
|
static void |
TextBooleanReference.write(boolean value,
BytesStore<?,?> bytes,
long offset)
Writes a boolean value to the specified
BytesStore at the given offset
in text wire format. |
| Modifier and Type | Method and Description |
|---|---|
protected @NotNull String |
Bit8StringInterner.getValue(@NotNull BytesStore<?,?> cs,
int length)
Returns a String value from the provided
BytesStore object. |
protected abstract T |
AbstractInterner.getValue(BytesStore<?,?> bs,
int length)
Retrieves the value corresponding to the bytes store and length.
|
protected @NotNull String |
UTF8StringInterner.getValue(@NotNull BytesStore<?,?> cs,
int length)
Converts the bytes from a
BytesStore into a UTF-8 encoded string. |
T |
AbstractInterner.intern(@NotNull BytesStore<?,?> cs)
Interns the specified BytesStore object.
|
T |
AbstractInterner.intern(@NotNull BytesStore<?,?> cs,
int length)
Interns the specified Bytes.
|
Copyright © 2024. All rights reserved.