public enum ByteUtils extends java.lang.Enum<ByteUtils>
Modifier and Type | Field and Description |
---|---|
static int |
MAX_BYTES_VLONG |
Modifier and Type | Method and Description |
---|---|
static double |
readDoubleLE(byte[] arr,
int offset)
Read a double in little-endian format.
|
static float |
readFloatLE(byte[] arr,
int offset)
Read a float in little-endian format.
|
static int |
readIntLE(byte[] arr,
int offset)
Read an int in little-endian format.
|
static long |
readLongLE(byte[] arr,
int offset)
Write a long in little-endian format.
|
static long |
readVLong(org.apache.lucene.store.ByteArrayDataInput in)
Same as DataOutput#readVLong but can read negative values (read on 9 bytes).
|
static ByteUtils |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static ByteUtils[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
static void |
writeDoubleLE(double d,
byte[] arr,
int offset)
Write a double in little-endian format.
|
static void |
writeFloatLE(float d,
byte[] arr,
int offset)
Write a float in little-endian format.
|
static void |
writeIntLE(int l,
byte[] arr,
int offset)
Write an int in little-endian format.
|
static void |
writeLongLE(long l,
byte[] arr,
int offset)
Write a long in little-endian format.
|
static void |
writeVLong(org.apache.lucene.store.ByteArrayDataOutput out,
long i)
Same as DataOutput#writeVLong but accepts negative values (written on 9 bytes).
|
static long |
zigZagDecode(long n)
Zig-zag decode.
|
static long |
zigZagEncode(long n)
Zig-zag encode: this helps transforming small signed numbers into small positive numbers.
|
public static final int MAX_BYTES_VLONG
public static ByteUtils[] values()
for (ByteUtils c : ByteUtils.values()) System.out.println(c);
public static ByteUtils valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic static long zigZagDecode(long n)
public static long zigZagEncode(long n)
public static void writeLongLE(long l, byte[] arr, int offset)
public static long readLongLE(byte[] arr, int offset)
public static void writeIntLE(int l, byte[] arr, int offset)
public static int readIntLE(byte[] arr, int offset)
public static void writeDoubleLE(double d, byte[] arr, int offset)
public static double readDoubleLE(byte[] arr, int offset)
public static void writeFloatLE(float d, byte[] arr, int offset)
public static float readFloatLE(byte[] arr, int offset)
public static void writeVLong(org.apache.lucene.store.ByteArrayDataOutput out, long i)
public static long readVLong(org.apache.lucene.store.ByteArrayDataInput in)