|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object backtype.storm.utils.WritableUtils
public final class WritableUtils
Constructor Summary | |
---|---|
WritableUtils()
|
Method Summary | |
---|---|
static int |
decodeVIntSize(byte value)
Parse the first byte of a vint/vlong to determine the number of bytes |
static void |
displayByteArray(byte[] record)
|
static int |
getVIntSize(long i)
Get the encoded length if an integer is stored in a variable-length format |
static boolean |
isNegativeVInt(byte value)
Given the first byte of a vint/vlong, determine the sign |
static byte[] |
readCompressedByteArray(java.io.DataInput in)
|
static java.lang.String |
readCompressedString(java.io.DataInput in)
|
static java.lang.String[] |
readCompressedStringArray(java.io.DataInput in)
|
static java.lang.String |
readString(java.io.DataInput in)
|
static java.lang.String[] |
readStringArray(java.io.DataInput in)
|
static int |
readVInt(java.io.DataInput stream)
Reads a zero-compressed encoded integer from input stream and returns it. |
static long |
readVLong(java.io.DataInput stream)
Reads a zero-compressed encoded long from input stream and returns it. |
static void |
skipCompressedByteArray(java.io.DataInput in)
|
static void |
skipFully(java.io.DataInput in,
int len)
Skip len number of bytes in input streamin |
static int |
writeCompressedByteArray(java.io.DataOutput out,
byte[] bytes)
|
static int |
writeCompressedString(java.io.DataOutput out,
java.lang.String s)
|
static void |
writeCompressedStringArray(java.io.DataOutput out,
java.lang.String[] s)
|
static void |
writeString(java.io.DataOutput out,
java.lang.String s)
|
static void |
writeStringArray(java.io.DataOutput out,
java.lang.String[] s)
|
static void |
writeVInt(java.io.DataOutput stream,
int i)
Serializes an integer 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WritableUtils()
Method Detail |
---|
public static byte[] readCompressedByteArray(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static void skipCompressedByteArray(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static int writeCompressedByteArray(java.io.DataOutput out, byte[] bytes) throws java.io.IOException
java.io.IOException
public static java.lang.String readCompressedString(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static int writeCompressedString(java.io.DataOutput out, java.lang.String s) throws java.io.IOException
java.io.IOException
public static void writeString(java.io.DataOutput out, java.lang.String s) throws java.io.IOException
java.io.IOException
public static java.lang.String readString(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static void writeStringArray(java.io.DataOutput out, java.lang.String[] s) throws java.io.IOException
java.io.IOException
public static void writeCompressedStringArray(java.io.DataOutput out, java.lang.String[] s) throws java.io.IOException
java.io.IOException
public static java.lang.String[] readStringArray(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static java.lang.String[] readCompressedStringArray(java.io.DataInput in) throws java.io.IOException
java.io.IOException
public static void displayByteArray(byte[] record)
public static void writeVInt(java.io.DataOutput stream, int i) throws java.io.IOException
stream
- Binary output streami
- Integer to be serialized
java.io.IOException
public static void writeVLong(java.io.DataOutput stream, long i) throws java.io.IOException
stream
- Binary output streami
- Long to be serialized
java.io.IOException
public static long readVLong(java.io.DataInput stream) throws java.io.IOException
stream
- Binary input stream
java.io.IOException
public static int readVInt(java.io.DataInput stream) throws java.io.IOException
stream
- Binary input stream
java.io.IOException
public static boolean isNegativeVInt(byte value)
value
- the first byte
public static int decodeVIntSize(byte value)
value
- the first byte of the vint/vlong
public static int getVIntSize(long i)
public static void skipFully(java.io.DataInput in, int len) throws java.io.IOException
in
- input streamlen
- number of bytes to skip
java.io.IOException
- when skipped less number of bytes
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |