public class CodecUtils extends Object
Constructor and Description |
---|
CodecUtils() |
Modifier and Type | Method and Description |
---|---|
static void |
appendVInt(int i,
org.apache.lucene.util.BytesRef ref)
Writes an integer in a variable-length format.
|
static int |
byteArrayToInt(byte[] src,
int offset)
Convert a byte array to an int (32bit word).
|
static int |
byteArrayToVInt(org.apache.lucene.util.BytesRef ref)
Reads an int stored in variable-length format.
|
static void |
intToByteArray(int x,
byte[] dst,
int offset)
Convert an integer to a byte array.
|
static void |
vIntToByteArray(int i,
ByteBuffer bb)
Writes an integer in a variable-length format.
|
static void |
writeBytes(byte[] array)
Display the content, i.e.
|
static void |
writeIndentBytes(byte[] array)
Display the content, i.e.
|
public static int byteArrayToInt(byte[] src, int offset)
src
- The byte array (length = 4)offset
- The offset of the encoded integer in the byte arraypublic static final void intToByteArray(int x, byte[] dst, int offset)
x
- The integerdst
- The byte array (length = 4)offset
- The offset of the encoded integer in the byte arraypublic static void vIntToByteArray(int i, ByteBuffer bb)
DataInput.readVInt()
public static int byteArrayToVInt(org.apache.lucene.util.BytesRef ref)
public static void appendVInt(int i, org.apache.lucene.util.BytesRef ref)
DataInput.readVInt()
public static void writeBytes(byte[] array)
array
- The byte arraypublic static void writeIndentBytes(byte[] array)
array
- The byte arrayCopyright © 2014. All rights reserved.