public class IOUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static char[] |
hexchars |
| Modifier and Type | Method and Description |
|---|---|
static int |
compareBytes(byte[] b1,
int s1,
int l1,
byte[] b2,
int s2,
int l2)
Lexicographic order of binary data.
|
static int |
getVIntSize(long i)
Get the encoded length if an integer is stored in a variable-length format
|
static double |
readDouble(byte[] bytes,
int start)
Parse a double from a byte array.
|
static float |
readFloat(byte[] bytes,
int start)
Parse a float from a byte array.
|
static int |
readVInt(byte[] bytes,
int start)
Reads a zero-compressed encoded integer from a byte array and returns it.
|
static int |
readVInt(java.io.DataInput in)
Reads a zero-compressed encoded integer from a stream and returns it.
|
static long |
readVLong(byte[] bytes,
int start)
Reads a zero-compressed encoded long from a byte array and returns it.
|
static long |
readVLong(java.io.DataInput in)
Reads a zero-compressed encoded long from a stream and return it.
|
static void |
writeVInt(java.io.DataOutput stream,
int i)
Serializes an int to a binary stream with zero-compressed encoding.
|
static void |
writeVLong(java.io.DataOutput stream,
long i)
Serializes a long to a binary stream with zero-compressed encoding.
|
public static float readFloat(byte[] bytes,
int start)
public static double readDouble(byte[] bytes,
int start)
public static long readVLong(byte[] bytes,
int start)
throws java.io.IOException
bytes - byte array with decode longstart - starting indexjava.io.IOExceptionpublic static int readVInt(byte[] bytes,
int start)
throws java.io.IOException
bytes - byte array with the encoded integerstart - start indexjava.io.IOExceptionpublic static long readVLong(java.io.DataInput in)
throws java.io.IOException
in - input streamjava.io.IOExceptionpublic static int readVInt(java.io.DataInput in)
throws java.io.IOException
in - input streamjava.io.IOExceptionpublic static int getVIntSize(long i)
public static void writeVLong(java.io.DataOutput stream,
long i)
throws java.io.IOException
stream - Binary output streami - Long to be serializedjava.io.IOExceptionpublic static void writeVInt(java.io.DataOutput stream,
int i)
throws java.io.IOException
stream - Binary output streami - int to be serializedjava.io.IOExceptionpublic static int compareBytes(byte[] b1,
int s1,
int l1,
byte[] b2,
int s2,
int l2)