public class WireDumper extends Object
| Modifier and Type | Method and Description |
|---|---|
@NotNull String |
asString()
Obtains a string representation of the entire content present in the bytes.
|
@NotNull String |
asString(boolean abbrev)
Obtains a string representation of the content from the current read position.
|
@NotNull String |
asString(long position,
long length)
Returns a string representation of the content located at the given position and length in the bytes.
|
@NotNull String |
asString(long position,
long length,
boolean abbrev)
Returns a string representation of the content located at the given position and length in the bytes.
|
void |
dumpAsHexadecimal(@NotNull StringBuilder sb,
int len,
long readPosition,
int sblen)
Dumps the content of the byte buffer as a hexadecimal representation into the provided StringBuilder.
|
boolean |
dumpOne(@NotNull StringBuilder sb,
@Nullable net.openhft.chronicle.bytes.Bytes<?> buffer)
Dumps a single wire entry from the internal byte buffer to the provided StringBuilder.
|
boolean |
dumpOne(@NotNull StringBuilder sb,
@Nullable net.openhft.chronicle.bytes.Bytes<?> buffer,
boolean abbrev)
Dumps a single wire entry from the internal byte buffer to the provided StringBuilder.
|
static @NotNull WireDumper |
of(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
Factory method to create a new WireDumper instance given a
Bytes object. |
static @NotNull WireDumper |
of(@NotNull net.openhft.chronicle.bytes.Bytes<?> bytes,
boolean align)
Factory method to create a new WireDumper instance given a
Bytes object and an alignment preference. |
static @NotNull WireDumper |
of(@NotNull WireIn wireIn)
Factory method to create a new WireDumper instance given a
WireIn object. |
@NotNull public static @NotNull WireDumper of(@NotNull @NotNull WireIn wireIn)
WireIn object.wireIn - The WireIn instance to be dumped@NotNull public static @NotNull WireDumper of(@NotNull @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes)
Bytes object.
This method uses default padding alignment.bytes - The Bytes object containing the raw data to be dumped@NotNull public static @NotNull WireDumper of(@NotNull @NotNull net.openhft.chronicle.bytes.Bytes<?> bytes, boolean align)
Bytes object and an alignment preference.bytes - The Bytes object containing the raw data to be dumpedalign - Boolean value indicating whether to align the dumped data@NotNull public @NotNull String asString()
@NotNull public @NotNull String asString(boolean abbrev)
abbrev - Boolean value indicating whether to use abbreviated format@NotNull public @NotNull String asString(long position, long length)
position - Starting position of the content to be representedlength - Length of the content to be represented@NotNull public @NotNull String asString(long position, long length, boolean abbrev)
position - Starting position of the content to be representedlength - Length of the content to be representedabbrev - Boolean value indicating whether to use abbreviated formatpublic boolean dumpOne(@NotNull
@NotNull StringBuilder sb,
@Nullable
@Nullable net.openhft.chronicle.bytes.Bytes<?> buffer)
sb - StringBuilder to which the wire entry will be appendedbuffer - Temporary buffer to assist in dumping the wire entrypublic boolean dumpOne(@NotNull
@NotNull StringBuilder sb,
@Nullable
@Nullable net.openhft.chronicle.bytes.Bytes<?> buffer,
boolean abbrev)
sb - StringBuilder to which the wire entry will be appendedbuffer - Temporary buffer to assist in dumping the wire entryabbrev - Boolean value indicating whether to use abbreviated formatpublic void dumpAsHexadecimal(@NotNull
@NotNull StringBuilder sb,
int len,
long readPosition,
int sblen)
sb - The StringBuilder to which the hexadecimal string will be appended.len - The length or number of bytes to read and convert to hexadecimal.readPosition - The starting position in the byte buffer from which to start reading.sblen - The length to reset the StringBuilder to. This is typically used to overwrite any existing content.Copyright © 2024. All rights reserved.