public enum BytesUtil extends Enum<BytesUtil>
Modifier and Type | Method and Description |
---|---|
static void |
appendBytesFromStart(@NotNull Bytes<?> bytes,
long startPosition,
@NotNull StringBuilder sb) |
static void |
appendUtf8(@NotNull StreamingDataOutput out,
@NotNull CharSequence cs) |
static int |
asInt(@NotNull String str) |
static boolean |
bytesEqual(@Nullable CharSequence cs,
@NotNull RandomDataInput bs,
long offset,
int length) |
static boolean |
bytesEqual(@NotNull RandomDataInput a,
long offset,
@NotNull RandomDataInput second,
long secondOffset,
long len) |
static boolean |
byteToBoolean(byte b) |
static void |
combineDoubleNewline(Bytes<?> bytes)
If the last two characters were a newline, rewind one character so there is only one newline.
|
static void |
copy8bit(BytesStore bs,
long addressForWrite,
long length) |
static boolean |
equals(Object o1,
Object o2) |
static String |
findFile(@NotNull String name) |
static boolean |
isTriviallyCopyable(@NotNull Class<?> clazz)
Is the whole class trivially copyable
|
static boolean |
isTriviallyCopyable(Class clazz,
int offset,
int length)
Are all the fields in the range given trivially copyable
|
static long |
padOffset(long from) |
static void |
parseUtf8(@NotNull StreamingDataInput in,
Appendable appendable,
int utflen) |
static void |
read8ByteAlignPadding(Bytes<?> bytes) |
static Bytes<?> |
readFile(@NotNull String name) |
static void |
readMarshallable(@NotNull ReadBytesMarshallable marshallable,
BytesIn<?> bytes) |
static long |
readStopBit(@NotNull StreamingDataInput in) |
static void |
reverse(Bytes<?> text,
int start) |
static long |
roundNup(double d,
long factor) |
static long |
roundUpTo64ByteAlign(long x) |
static long |
roundUpTo8ByteAlign(long x) |
static int |
stopBitLength(long n) |
static @NotNull char[] |
toCharArray(@NotNull Bytes<?> bytes) |
static @NotNull char[] |
toCharArray(@NotNull Bytes<?> bytes,
long position,
int length) |
static String |
toDebugString(@NotNull RandomDataInput bytes,
long start,
long maxLength) |
static int |
triviallyCopyableLength(Class clazz)
Return the length of trivially copyable fields, note references are ignored as they are not trivially copyable.
|
static int[] |
triviallyCopyableRange(Class clazz) |
static int |
triviallyCopyableStart(Class clazz)
Return the first byte of trivially copyable fields.
|
static BytesUtil |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static BytesUtil[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static void |
write8ByteAlignPadding(Bytes<?> bytes) |
static void |
writeFile(String file,
Bytes<byte[]> bytes) |
static void |
writeMarshallable(@NotNull WriteBytesMarshallable marshallable,
BytesOut<?> bytes) |
static long |
writeStopBit(BytesStore bs,
long offset,
long n) |
static long |
writeStopBit(long addr,
long n) |
static void |
writeStopBit(@NotNull StreamingDataOutput out,
long n) |
public static BytesUtil[] values()
for (BytesUtil c : BytesUtil.values()) System.out.println(c);
public static BytesUtil valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic static boolean isTriviallyCopyable(@NotNull @NotNull Class<?> clazz)
clazz
- to checkpublic static boolean isTriviallyCopyable(Class clazz, int offset, int length)
clazz
- to checkoffset
- start of field arealength
- of the field areapublic static int[] triviallyCopyableRange(Class clazz)
public static int triviallyCopyableStart(Class clazz)
clazz
- to examinepublic static int triviallyCopyableLength(Class clazz)
clazz
- to examinepublic static String findFile(@NotNull @NotNull String name) throws FileNotFoundException
FileNotFoundException
public static Bytes<?> readFile(@NotNull @NotNull String name) throws IOException
IOException
public static void writeFile(String file, Bytes<byte[]> bytes) throws IOException
IOException
public static boolean bytesEqual(@NotNull @NotNull RandomDataInput a, long offset, @NotNull @NotNull RandomDataInput second, long secondOffset, long len) throws BufferUnderflowException, IllegalStateException
public static boolean bytesEqual(@Nullable @Nullable CharSequence cs, @NotNull @NotNull RandomDataInput bs, long offset, int length) throws IllegalStateException, BufferUnderflowException
public static int asInt(@NotNull @NotNull String str)
public static int stopBitLength(long n)
@NotNull public static @NotNull char[] toCharArray(@NotNull @NotNull Bytes<?> bytes) throws ArithmeticException, IllegalStateException, BufferUnderflowException
@NotNull public static @NotNull char[] toCharArray(@NotNull @NotNull Bytes<?> bytes, long position, int length) throws IllegalStateException, BufferUnderflowException
public static long readStopBit(@NotNull @NotNull StreamingDataInput in) throws net.openhft.chronicle.core.io.IORuntimeException, IllegalStateException
net.openhft.chronicle.core.io.IORuntimeException
IllegalStateException
public static void writeStopBit(@NotNull @NotNull StreamingDataOutput out, long n) throws IllegalStateException, BufferOverflowException
public static long writeStopBit(BytesStore bs, long offset, long n) throws IllegalStateException, BufferOverflowException
IllegalStateException
BufferOverflowException
public static long writeStopBit(long addr, long n) throws IllegalStateException, BufferOverflowException
IllegalStateException
BufferOverflowException
public static void parseUtf8(@NotNull @NotNull StreamingDataInput in, Appendable appendable, int utflen) throws UTFDataFormatRuntimeException, IllegalStateException, BufferUnderflowException
public static void appendUtf8(@NotNull @NotNull StreamingDataOutput out, @NotNull @NotNull CharSequence cs) throws IndexOutOfBoundsException
IndexOutOfBoundsException
public static void appendBytesFromStart(@NotNull @NotNull Bytes<?> bytes, long startPosition, @NotNull @NotNull StringBuilder sb) throws IllegalStateException
IllegalStateException
public static void readMarshallable(@NotNull @NotNull ReadBytesMarshallable marshallable, BytesIn<?> bytes)
public static void writeMarshallable(@NotNull @NotNull WriteBytesMarshallable marshallable, BytesOut<?> bytes) throws IllegalStateException, BufferOverflowException, ArithmeticException, BufferUnderflowException
public static boolean byteToBoolean(byte b)
public static long roundUpTo64ByteAlign(long x)
public static long roundUpTo8ByteAlign(long x)
public static void read8ByteAlignPadding(Bytes<?> bytes) throws IllegalStateException, BufferUnderflowException
public static void write8ByteAlignPadding(Bytes<?> bytes) throws BufferOverflowException, IllegalStateException
public static String toDebugString(@NotNull @NotNull RandomDataInput bytes, long start, long maxLength) throws IllegalStateException, BufferUnderflowException, ArithmeticException
public static void copy8bit(BytesStore bs, long addressForWrite, long length)
public static void reverse(Bytes<?> text, int start)
public static long roundNup(double d, long factor)
public static long padOffset(long from)
public static void combineDoubleNewline(Bytes<?> bytes)
bytes
- to check and trim as needed.Copyright © 2022. All rights reserved.