|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.siefkes.nlstego.util.NumUtils
public final class NumUtils
A static utility class that provides methods for working with numbers. No instances of this class can be created, only the static members should be used.
| Method Summary | |
|---|---|
static long |
decodeVInt(InputStream in)
Reads a number in the variable-length VInt format (as used by Apache Lucene). |
static byte[] |
encodeVInt(long num)
Encodes a number in the variable-length VInt format (as used by Apache Lucene). |
static void |
encodeVInt(long num,
OutputStream out)
Encodes a number in the variable-length VInt format (as used by Apache Lucene). |
static boolean |
endsVInt(byte b)
Checks whether a byte is the last byte of a number stored in the variable-length VInt format (as used by Apache Lucene). |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static long decodeVInt(InputStream in)
throws IOException
in - the stream to read from
IOException - if an I/O error occurs while readingpublic static boolean endsVInt(byte b)
b - the byte to check
true if the byte looks like the last byte in a VInt
public static void encodeVInt(long num,
OutputStream out)
throws IOException
num - the number to writeout - the stream to write the number to
IOException - if an I/O error occurs while writingpublic static byte[] encodeVInt(long num)
num - the number to write
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||